I just have an in image in picturebox.
ho to insert this picturebox in the head of richtexbox?
insert IMAGE IN RICHTEXTBOX
-
- Administrator
- Posts: 78448
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 548
- Joined: 27 Jun 2021, 10:46
Re: insert IMAGE IN RICHTEXTBOX
Not sure what you mean by "head of richtexbox"
Assuming that you are talking VB6, here's one way to get an image into a richtexbox at the current insertion point:
Assuming that you are talking VB6, here's one way to get an image into a richtexbox at the current insertion point:
Code: Select all
Dim mypic As New StdPicture
Set mypic = LoadPicture("C:\Program Files\Microsoft Visual Studio\Common\Graphics\Bitmaps\Assorted\spade.bmp")
Clipboard.SetData mypic
RichTextBox1.SetFocus
SendKeys "^V"
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
Re: insert IMAGE IN RICHTEXTBOX
TKS.
But resolved with:
Code: Select all
Private Sub Command2_Click()
Picture1.AutoRedraw = True
Me.RichTextBox2.Text = ""
Clipboard.Clear
Clipboard.SetData Picture1.Picture
RichTextBox2.SelStart = 0
RichTextBox2.SelAlignment = 2
SendMessage Me.RichTextBox2.hWnd, WM_PASTE, 0, 0
Me.RichTextBox2.text="test"
End Sub
when i print a new line with:
Me.RichTextBox2.text="test", the image is cleared!
Peraphs before to print a new text line i move the cursor, under image...
-
- Administrator
- Posts: 78448
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: insert IMAGE IN RICHTEXTBOX
Perhaps
Code: Select all
Me.RichTextBox2.Text = Me.RichTextBox2.Text & "test"
Best wishes,
Hans
Hans