如何获取Memo的行数与列数《转》
var Hang,Lie,Num,CharsLine:longint; begin Num:=SendMessage(Memo1.Handle,EM_LINEFROMCHAR,Memo1.SelStart,0); CharsLine:=SendMessage(Memo1.Handle,EM_LINEINDEX,Num,0); Hang:=Num+1;//当前行 Label3.Caption :='行数= '+IntToStr(Hang) ; Lie:=(Memo1.SelStart-CharsLine)+1;//当前列 Label4.Caption :='列数= '+IntToStr(Lie) ;