WEB开发网
开发学院软件开发Delphi 获得Memo、RichEdit的光标位置 阅读

获得Memo、RichEdit的光标位置

 2006-02-04 13:41:23 来源:WEB开发网   
核心提示: 获得Memo、RichEdit的光标位置:PRocedure TForm1.Button1Click(Sender: TObject);var Row, Col : integer;begin Row := SendMessage(Memo1.Handle, EM_LINEFROMCHAR, Memo1.SelSt
 

获得Memo、RichEdit的光标位置:


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:='行,列:'+IntToStr(Row)+','+IntToStr(Col);
end;

Tags:获得 Memo RichEdit

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接