?
Solved

mouse xy

Posted on 2000-05-13
3
Medium Priority
?
461 Views
Last Modified: 2006-11-17
how do i get the coordinates when i click at a imagebox?
0
Comment
Question by:karelin
  • 2
3 Comments
 

Expert Comment

by:miche
ID: 2807338
Use MouseDown or MouseUpEvent.

Regards,
Miche.
0
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 2807350
hi,
on one of the mouse events do:

var
  CursorPos : TPoint;
 begin
   { get mouse cursor position }
GetCursorPos(CursorPos);
   { show our mouse mos }
label1.caption :=inttostr(CursorPos.X);
label2.caption :=inttostr(CursorPos.Y);
end;

Regards Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 2807362
or should i say you can use "either" the uncommented code or the commented code whichever one suits you best:


procedure TForm1.Image1MouseUp(Sender: 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;
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Loops Section Overview
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question