Vectorlight News

  • Chat App Converted to HTML and JQuery
    Sep 08, 2011

    Converted from Silverlight to HTML and Javascript/JQuery is the Vectorlight Chat App. Login using your Vectorlight password to chat using your username and avatar.

  • HTML5 iPhone,Android Big Guns Tower Defense
    Jul 02, 2011

    Big Guns has made the leap from Windows Phone 7 (XNA) to HTML5 so you can now play it on your iPhone, Android and other HTML5 compatible devices.

  • HTML5 Games - Word Poppers and Batty
    Jun 04, 2011

    As the take-up of HTML5 quickens (74% of users currently have a browser capable of HTML5 Canvas) we present two more games for both your browser and mobile.

  • Big Guns Tower Defense on Windows Phone 7
    May 06, 2011

    Coming soon to Windows Phone 7 is an XNA port of the popular Vectorlight tower defense game Super Tower Defense. Whilst retaining many of the graphical and gameplay features of the original Silverlight game.

  • Wakacube WP7 Update
    Apr 26, 2011

    Released to the Windows Phone 7 marketplace today is Version 1.1 of Wakacube the 3D physics game of skill. Included in the update are more levels (30 in total) and new mode Wakatime which generates random crate structures to keep players entertained long after the levels have been completed.

  • Home Page News
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!