How to click-and-select a line in TMemo<br>From Zarko Gajic,<br>Your Guide to Delphi Programming.<br>FREE Newsletter. Sign Up Now!<br>Here's how to select a row (line) of text in a TMemo control by clicking on it: <br><br>Noterop a TMemo (Memo1) on a form and call the "SelectMemoLine" procedure from Memo's OnClick event:<br>~~~~~~~~~~~~~~~~~~~~~~~~~<br>procedure SelectMemoLine(Memo : TCustomMemo) ;<br>var<br> Line : integer;<br>begin<br> with Memo do<br> begin<br> Line := Perform(EM_LINEFROMCHAR, SelStart, 0) ;<br> SelStart := Perform(EM_LINEINDEX, Line, 0) ;<br> SelLength := Length(Lines[Line]) ;<br> end;<br>end;<br><br>//Usage: <br>procedure TForm1.Memo1Click(Sender: TObject) ;<br>begin<br> SelectMemoLine(Memo1) ;<br>end;