karelin
asked on
mouse xy
how do i get the coordinates when i click at a imagebox?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
or should i say you can use "either" the uncommented code or the commented code whichever one suits you best:
procedure TForm1.Image1MouseUp(Sende r: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
//var
// CursorPos : TPoint;
begin
label1.caption :=inttostr(X);
label2.caption :=inttostr(Y);
//GetCursorPos(CursorPos);
//label1.caption :=inttostr(CursorPos.X);
//label2.caption :=inttostr(CursorPos.Y);
end;
procedure TForm1.Image1MouseUp(Sende
Shift: TShiftState; X, Y: Integer);
//var
// CursorPos : TPoint;
begin
label1.caption :=inttostr(X);
label2.caption :=inttostr(Y);
//GetCursorPos(CursorPos);
//label1.caption :=inttostr(CursorPos.X);
//label2.caption :=inttostr(CursorPos.Y);
end;
Regards,
Miche.