Determine the current row and columns in the MEMO control by calling the API

zhaozj2021-02-11  221

Determine the current row and columns in the MEMO control by calling the API

You can call the em-lineFrom-CHAR and EM-LineIndex functions in WindowsAPI to determine the current rows and columns in the MEM O control, and the process of specific calls see the following procedure. var LineNum: longint; CharsBeforeLine: longint; begin LineNumΚSendMessage (Memo1.Handle, EM-LINEFROMCHAR, Memo1.SelSta rt, 0); CharsBeforeLine: = SendMessage (Memo1.Handle, EM-LINEINDEX, LineNum, 0); Label1. Caption: = 'Line' INTOSTR (LINENUM 1) Label2. Caption: = 'Position' INTOSTR ((Memo1.Selstart-Charsbe Foreline 1);

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

New Post(0)