• Advertisement
Sign in to follow this  

Images in rich text box

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement