procedure SelectMemoLine(Memo : TCustomMemo) ;
var
Line : integer;
begin
with Memo do
begin
Line := Perform(EM_LINEFROMCHAR, SelStart, 0) ;
SelStart := Perform(EM_LINEINDEX, Line, 0) ;
SelLength := Length(Lines[Line]) ;
end;
end;
//Usage:
procedure TForm1.Memo1Click(Sender: TObject) ;
begin
SelectMemoLine(Memo1) ;
end;
阅读(3594) | 评论(0) | 转发(0) |