Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
hi,

i have a window application in vb.net.

i need to add smilies or emotions in richtextbox with text (like yahoo chat).

suppose i have written: hi how are you -smile-
it will replace: hi how are you and (-smile- with image)

thanks in advance. please help me.
Posted 27-Mar-11 21:50pm
kals84713
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This article [^]should suit your requirements.
  Permalink  
Comments
kals84 at 28-Mar-11 3:34am
   
thanks for the solution but i need the code in vb.net not in c# as i don't know c#
Smithers-Jones at 28-Mar-11 6:43am
   
Sigh. Google for "convert c# to vb.net".
SAKryukov at 28-Mar-11 22:30pm
   
Yes, good matter, a 5.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hope this[^] might help you.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You can display a UIElement, such as an Image or a Button, in a RichTextBox.

This enables rich text scenarios, such as displaying content from a chat client and showing emoticons.

UI elements are active when the RichTextBox is in read-only mode and inactive in edit mode. For example, they can respond to input and receive focus only when they are in read-only mode. Use the InlineUIContainer tag to add content that is derived from UIElement.

The following shows how to add an image to a RichTextBox.
'A RichTextBox with an image.
                      Private
                      Sub ImageRTB()
    'Create a new RichTextBox.Dim MyRTB AsNew RichTextBox()

    ' Create a Run of plain text and image.Dim myRun AsNew Run()
    myRun.Text = "Displaying text with inline image"Dim MyImage AsNew Image()
    MyImage.Source = New BitmapImage(New Uri("flower.jpg", UriKind.RelativeOrAbsolute))
    MyImage.Height = 50
    MyImage.Width = 50
    Dim MyUI AsNew InlineUIContainer()
    MyUI.Child = MyImage
 
    ' Create a paragraph and add the paragraph to the RichTextBox.Dim myParagraph AsNew Paragraph()
    MyRTB.Blocks.Add(myParagraph)
 
    ' Add the Run and image to it.
    myParagraph.Inlines.Add(myRun)
    myParagraph.Inlines.Add(MyUI)
 
    'Add the RichTextBox to the StackPanel.
    MySP.Children.Add(MyRTB)
EndSub
Extracted from: http://msdn.microsoft.com/en-us/library/ee681613(v=vs.95).aspx[^]

Hope this helps,
AlienHamster
  Permalink  
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 6,534
1 OriginalGriff 6,258
2 Peter Leow 2,534
3 Maciej Los 2,308
4 Abhinav S 2,274


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100