procedure TForm1.Memo1Click(Sender: TObject);var Line: Integer;begin Line := Memo1.Lines.Count - 1; Memo1.SelStart := Perform(EM_LINEINDEX, Line, 0); Memo1.SelLength := Length(Memo1.Lines[Line]);end;