I have a RichTextbox
in a C# Windows Forms application
. I wanna convert the texts like :D
or :P
to the relevant smileys when some texts arrive to this form.
I have this part of code but whenever the form is updated it removes all smileys that were arrived before and just shows the smileys in the last line.
Is it possible to just update the last line of the form?
foreach (string emot in Emoticons.Keys)
{
while (RTxtBx_Main.Text.Contains(emot))
{
int index = RTxtBx_Main.Text.IndexOf(emot);
RTxtBx_Main.Select(index, emot.Length);
Clipboard.SetImage((Image)Emoticons[emot]);
RTxtBx_Main.Paste();
}
}