Procedure CursorPosition (CONTROL: TMEMO; COL, ROW: Integer); VAR POS: Integer; Begin // Checks whether the number of rows exceeds the actual number of rows! Elect the last line if col> control.lines.count the col: = SendMessage (Control.handle, EM_GETLINECUNT, 0, 0) -1; POS: = SendMessage (Control.handle, EM_LINDEX, COL, 0) Row; Control.Selstart: = POS; END; also learn as follows!
LOPS: = SendMessage (Memol.Handle, EM_LINEFROMCHAR, MEMO1.SELSTART, 0); CPOS: = Memol.Selstart-sendMessage (Meno1.Handle, EM_LINDEX, LPOS, 0);
Get the rows and columns of the current cursor in the MEMO1 control!