OnClick event

If using OnMouseDown event we know the position of mouse.
How if using OnClick event ?

Regards,
Joely
joelyAsked:
Who is Participating?
 
kretzschmarConnect With a Mentor Commented:
hi joely,

try this

procedure TForm1.Button1Click(Sender: TObject);
var P : TPoint;
begin
  GetCursorPos(P);
  { Physically Position }
  edit1.text := inttoStr(p.x);
  edit2.text := inttoStr(p.y);
  { relativ Position to Container (i.e. Form) Client Area }}
  edit3.text := inttoStr(Screentoclient(P).x);
  edit4.text := inttoStr(Screentoclient(P).y);
end;

meikl
0
All Courses

From novice to tech pro — start learning today.