-
May 31st, 2014, 04:39 AM
#1
select and insirt picture in RichTextBox
hi,
i have a rich textbox and it contain a text, and i need to select the last line automatically by code. and i need to put a picture in the last line.
any idea to help me.
i use the below code :-
PHP Code:
' in module
Option Explicit
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, _
ByVal wMsg As Long, ByVal wParm As Long, IParam As Any) As Long
Public Const WM_PASTE = &H302
Private Const EM_GETLINECOUNT = &HBA
'------------------------------------------------------------------------------------
in button
Dim LineCount As Long
Clipboard.Clear
Clipboard.SetData Image1.Picture
SendMessage RichTextBox1.hwnd, WM_PASTE, 0&, 0&
this code is work but the picture come in the top( before text)
and i need to put it after the last line of text.
many thanks.
-
May 31st, 2014, 12:21 PM
#2
Re: select and insirt picture in RichTextBox
Create a .RTF MASTER with the picturebox and other placeholders. Then, it's easy to find/replace and insert images INTO the picturebox on the RTF that has it where it should be.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|