Pavan Contractor

Hi,

I want to add emoticons in RichTextBox in WPF application.How can I do this Can any one help me for that

Thanx and Regards,

Pavan



Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

Tamir Khason

You can embed controls inside RichTextBox, so you can add your emoticons as images. Something like this will work

<RichTextBox>
<FlowDocument IsEnabled="true">
<Paragraph>
This is some text before the inline emoticon.
<Image Source="mySmile.png"/>
And this is some text after the inline emoricon.
</Paragraph>
</FlowDocument>
</RichTextBox>






Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

Pavan Contractor

Hi,

Thanx for your help.Now I can add emoticons in my RichTextBox.I am making a Chat application that's why there is a need of string and emoticons combination in RichTextBox.So can you please tell me how to add both string and emoticons to gether.Also if I get String and Emoticons to gether in RichTextBox how can I send this combination to all users in Chat applications.

Thanx and Regards,

Pavan





Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

LesterLobo - MSFT

you could interpret the text input like ': )' as a smiley and include an inline image in its place....

as for sending it you would have to interpret the image as text and send it as a text string





Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

Ruchi Goyal

Hi,
I also want to interpret emotions as Text and text as emotions. If u have the solutions for this then can u plz share it with me.

Thanks
Ruchi Goyal
ruchi.goyal@proteans.com




Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

LesterLobo - MSFT

you will need to identify the text when typing.. for this listen tot the textchanged event which provides the changes (e.Changes) in the event handler... once you identify the emoticon text... get the pointers surronding it and replace with icon.

On sending the content, you will need to reverse the images into text since textrange.save will give you a blank space for images. so you will need to traverse through the inlines and replace the image with a Run with the equivalent emoticon text and then save it.

On the receivers end its a simple parse insert on the xaml string before loading it into the rtb....





Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

Ruchi Goyal

Hi.I am not able to find any e.changes in TextChangedEventArgs of richtextbox.Can u plz help me how to identify the emotion text.

Thanks
Ruchi Goyal




Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

LesterLobo - MSFT

this is available in .net 3.5





Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

Ruchi Goyal

do u have any idea abt how to get all the paragraphs or InlineCollection from the RichTextBox in .Net 3.0 or 3.5

Thanks
Ruchi




Re: Windows Presentation Foundation (WPF) Emoticons in RichTextBox

LesterLobo - MSFT

rtb.Document.Blocks gives the block collection... you can iterate through the blocks and typecast them into paragraph provided you dont have blockuicontainers

inside each para is an inlinecollection... para.Inlines...