//不能什么都要现成的,人的成长最终还是要靠自己
procedure TForm1.Memo1Click(Sender: TObject);
var
i: integer;
iTmp: integer;
iCount: integer;
begin
iTmp := memo1.CaretPos.Y;
iCount := 0;
for i:= 0 to iTmp-1 do
begin
iCount := iCount + Length(memo1.Lines.Strings)+Length(#13#10);
//每行有回车换行
end;
memo1.SelStart := iCount;
memo1.SelLength := Length(memo1.Lines.Strings[iTmp]);
end;