Latest News

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

  • New Sandmania Puzzle Game
    Jun 18, 2010

    Sandmania is the latest game from vectorlight, the aim of this game is to guide sand from the top of the screen to the various colored containers below.

  • New Moon Tower Defense Game
    May 29, 2010

    Added to the Games section is the new Moon Tower Defense game. Defend the Moon from the circling Aliens and Humans.

Navedac
Navedac
Use RichTextBox for chat application with smileys Posted: Oct 26, 2009
 

Hello

I try to addd your Rich TextBox to my application for adding smileys support in the chat box.

My first idea is to replace Silverlight TextBox by RichTextBox.


When Msg as string = "Hello :)"


I try to use this : richTextBox.RichText = msg; ( or directly richTextBox.RichText = "Hello :)"; )

 smiley do not appears.


what is the good way ?


Try my chat application here please : UserName : guest / Password : guest

http://www.furukoo.fr/furukoov2/TestPage.html


I need your help !


Thanks a lot


Yvan

 
 
dan
dan
RE: Use RichTextBox for chat application with smileys Posted: Oct 27, 2009
 

Hi,


Emoticon shortcuts are only processed when the user types in the RichTextBox.  To insert an emoticon during loading you simply add it as an image, for example:


richTextBox.HTML = "<p>Hello <img src=\"images/happy.png\" /></p>";


Assuming you have an image called happy.png in a folder called images in your Silverliht project.


Thanks!

 
 
sajigeo
sajigeo
RE: Use RichTextBox for chat application with smileys Posted: Oct 27, 2009
 

Hai Dan


I am also looking for the same emoticon while typing in the text area itself.

The refered URL http://www.vectorlight.net/demos/richtextbox.aspx its showing the feature of "Supporting Margin Formatting & Emoticons". - type :) and Smiley u will get.


Please reply any settings for this in RTF , please tell me how to do it would be greatful.


Thanks and Regards

Saji

 
 
dan
dan
RE: Use RichTextBox for chat application with smileys Posted: Oct 27, 2009
 

Hi Saji,


Certainly, have you downloaded the demo source code from:


http://www.vectorlight.net/demos/richtextbox.aspx


This contains all the code you need to implement emoticon replacement as you type, in brief however you need to setup the following in your RichTextBox:


richTextBox.TextPatterns.Add("*:)");

richTextBox.TextPatternMatch += new RichTextBoxEventHandler(richTextBox_TextPatternMatch);


private void richTextBox_TextPatternMatch(object sender, RichTextBoxEventArgs e)

{

    switch (e.Parameter.ToString())

    {

        case ":)":

            e.Parameter = new Image() { Source = new BitmapImage(new Uri("images/happy.png", UriKind.Relative)) };

            break;

    }

}


Firtly we tell the RichTextBox to look for the pattern ":)", when this pattern is found the TextPatternMatch event is called and you need to handle this in your code.  In the example above we are replacing the ":)" pattern with an image.


Thanks!

 
 
PanzertaxNoruga
PanzertaxNoruga
RE: Use RichTextBox for chat application with smileys Posted: Mar 12, 2010
 

Is it possible to insert a icon as xaml (canvas)  instead of a png? I have xaml icons that looks much better when scaling?

 
 
dan
dan
RE: Use RichTextBox for chat application with smileys Posted: Mar 20, 2010
 

Hi,


Sure, instead of adding an Image object you could add a Canvas or maybe a User Control.


Thanks!