I'm trying as best as I can to add a image into a Rich TextBox (ExRich TextBox)
This code
CODE
rtfChat.InsertImage(new Bitmap(typeof(ResourceManager), "Heart.png"));
Is what's giving me a real headache. Whenever I try to insert the image I get Error: "Can't Find the resource Heart.png In the Class System.Resources.ResourceManager" (roughly translated)
I have tried various typeof classes, but honestly I don't know which one to "select"
I'm stucked to say the least
The entire code is:
CODE
private void rtfChat_TextChanged(object sender, EventArgs e)
{
try
{
int _index;
if ((_index = rtfChat.Find(":)")) > -1) {
rtfChat.Select(_index, ":)".Length);
rtfChat.InsertImage(new Bitmap(typeof(ResourceManager), "Heart.png"));
}
}
What I'm actually trying to achieve is that whenever ":)" is active in the Rich Text the text ":)" should be replaced by a Image (not entire text, but only ":)" )
I've spent hours on this so I would really appreciate some help.