Highlight Memo line on double click lazarus / 31-LCL ---------------------------------------------------------------------- Roman · 2012-01-05 20:21 I'am trying to select a line in memo by double clicking into that line. Code is simple: Code: [Select]procedure TForm1.Memo1DblClick(Sender: TObject); begin   with Memo1 do   begin     SelStart:=SelStart-CaretPos.x;     SelLength:=Length(Lines[CaretPos.y])   end end;    but I get highlighted few characters from the end of previous line and almost whole line where caret is. What I am doing wrong? ---------------------------------------------------------------------- Avishai · 2012-01-06 05:39 procedure TForm1.Memo1DblClick(Sender: TObject); var   Row, Col: Integer; begin   Col:= Memo1.CaretPos.x;   Row:= Memo1.CaretPos.y;   Memo1.SelStart:= Memo1.SelStart+Memo1.SelLength-Col;   Memo1.SelLength:= Length(Memo1.Lines[Row]); end; ---------------------------------------------------------------------- Roman · 2012-01-06 06:37 This is it, thank you.