Put a jpg image from a custom resource into a richtextbox

I am trying to get around the hack of putting a picturebox inside another picturebox to get scroll bars for an image.
Can i load a custom jpg directly into a richtextbox if no
Then load the pic into a picturebox and then into RichTextbox
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FER_GCommented:
to probe this example, you need a pictureBox with an image loaded, a commandbutton (cmdInsertImg)
...
I hope it works for you...
FerG

Saludos.
--
Ing. Fernando D. Giletta
MP: 4035 CIEC
San Fco. Cba. Arg.

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
 
Private Const WM_PASTE = &H302
 
 
Private Sub cmdInsertImg_Click()
    ' Put the picture image into the clipboard.
    Clipboard.Clear
    Clipboard.SetData Picture1.Picture
 
    'paste the clipboard content.
    SendMessage RichTextBox1.hwnd, WM_PASTE, 0, 0 
end sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
That works, but it takes forever for the form to unload any ideas?
0
FER_GCommented:
I don't know what could happend, because it works ok for me...
Did you try the code alone, without any other code but only mine?

FerG

Saludos.
--
Ing. Fernando D. Giletta
MP: 4035 CIEC
San Fco. Cba. Arg.
0
isnoend2001Author Commented:
Don't know why either, even put into a new form with no other code, takes about 20 seconds to unload
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.