How to add a picture in a RTB
Hello everyone,
I am making a program that collects data from the user and then it prints it in a RTB. I can succesfully do this but I want to add a picture in the beggining of the RTB and I don't know to do it. I have the picture in the resources of the project. Can anyone help me? :)
Re: How to add a picture in a RTB
try this:
vb Code:
Clipboard.SetImage(My.Resources.[resourceName])
RichTextBox1.Paste()
Re: How to add a picture in a RTB
I tried doing this but it doesn't work. I tried renaming my picture(with no gaps and no .bmp) but it still didn't work.
Re: How to add a picture in a RTB
Pauls code works for me:
Code:
Clipboard.SetImage(My.Resources.Image1) 'Image1 is Image1.jpg in my resources
RichTextBox1.Paste()
Re: How to add a picture in a RTB
did you add the picture to my.resources?
Project-->Properties-->Resources-->Add Resource
if not you'll need to create a new bitmap + then put that on the clipboard before pasting