Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images in Rich text box

Status
Not open for further replies.

bhargava

MIS
May 3, 2001
26
0
0
IN
hi,

I need certain help in the application I am developing. I need to insert images in the rich text box control, which is the user's work area. I want the the images to function in the way as they function in Frontpage or Word, where if we move a character then the images shift by a character.

Picture box cannot be used because the size of image is not predetermined.

Kindly suggest

Regards

Amit Bhargava
 
Hi,

in reference to earlier messgae, picture boxes further cannot be used beacuse it is not known as to how many images would the user be inserting and where he would be inserting (location), in the work area.

Regards

Amit Bhargava
 
Pasting an image into a RichTextbox can be done through an API-call.
To try following example, add a picturebox that holds an image, a commandbutton, and a RichTextbox and then have i nice Christmass.

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 Command1_Click()
' Copy the picture into the clipboard.
Clipboard.Clear
Clipboard.SetData Picture1.Picture
' Paste the picture into the RichTextBox.
SendMessage RichTextBox1.hwnd, WM_PASTE, 0, 0
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top