W
weihang
Unregistered / Unconfirmed
GUEST, unregistred user!
Memo1.Perform(em_LineFromChar, -1, 0);
SendMessage(memo.Handle,EM_LINEFROMCHAR,RichEdit1.Selstart,0));
这两种方法可以获得行号,但如果程序如下:
memo1.Lines.strings[3]:='dfhsdoi';
showmessage(inttostr(Memo1.Perform(em_LineFromChar, -1, 0)));
showmessage(inttostr(SendMessage(memo1.handle, EM_LINEFROMCHAR, -1, 0 )));
但是总只能获得那个修改了的行的行号.
SendMessage(memo.Handle,EM_LINEFROMCHAR,RichEdit1.Selstart,0));
这两种方法可以获得行号,但如果程序如下:
memo1.Lines.strings[3]:='dfhsdoi';
showmessage(inttostr(Memo1.Perform(em_LineFromChar, -1, 0)));
showmessage(inttostr(SendMessage(memo1.handle, EM_LINEFROMCHAR, -1, 0 )));
但是总只能获得那个修改了的行的行号.