Get MEMO, Richedit cursor position

zhaozj2021-02-16  52

Get MEMO, Richedit cursor position:

procedure TForm1.Button1Click (Sender: TObject); var Row, Col: integer; begin Row: = SendMessage (Memo1.Handle, EM_LINEFROMCHAR, Memo1.SelStart, 0); Col: = CustEdit.SelStart - SendMessage (Memo1.Handle, EM_LINEINDEX , -1, 0); Edit1.Text: = 'row, column:' INTOSTR (ROW) ',' INTOSTR (COL);

Supersoyonc@sohu.com

转载请注明原文地址:https://www.9cbs.com/read-23131.html

New Post(0)