Public Group

Images in rich text box

This topic is 4859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Using C# how do you diplay a bitmap in a rich text box. I've tried to use this method:

richTextBox1.Text =new Bitmap(openFileDialog1.FileName);


but it dosen't show the picture it just returns some text, how do i make it return an image?

Share on other sites
Now I am not really a C# coder, but I think I see what the problem is.

You are trying to edit the text property of the Text box itself. The text property can only contain just that, Text. I just loaded up Visual C# and looked at the properties and methods of the Rich Text Box and I can't seem to find any that would relate to image drawing unto itself.
You are probably better off using a Picture Box, or if you know how to do it, using the Paint() method of C# and using a Graphics device there to draw a bitmap. Hope this helped. See ya later.

Share on other sites
Nope, not much help but thanks. I'll try posting in the .NET forums.

1. 1
2. 2
frob
16
3. 3
Rutin
12
4. 4
5. 5

• 13
• 12
• 59
• 14
• 15
• Forum Statistics

• Total Topics
632124
• Total Posts
3004244

×