05-31-2014, 07:08 AM
Join Date: Mar 2012
select and insert picture in RichTextBox
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 :-
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
Dim LineCount As Long
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.