Re: TMemo: How can i get the caret x/y pos. into client x/y pos. ?



Just in case somebody interested, ifound this in
newsgroup...

Newsgroups: borland.public.delphi.vcl.components.using
From: Mauro Patino <M-Pat...@xxxxxxxxx>

Use the GetCaretPos API function.
Read the windows sdk for more info.

procedure TForm1.Button1Click(Sender: TObject);
var
P: TPoint;
begin
GetCaretPos(P);

Label1.Caption := IntToStr(P.x);
Label2.Caption := IntToStr(P.y);
end;

If the function fails, the return value is zero.

if Get.. = 0 then
Fail

This function returns pixels x/y values as opposed to Memo.CaretPos
wich are line/char values...

Cheers,
Eddy.


.


Quantcast