Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OnClick event

Posted on 1998-10-19
1
Medium Priority
?
399 Views
Last Modified: 2010-04-06
If using OnMouseDown event we know the position of mouse.
How if using OnClick event ?

Regards,
Joely
0
Comment
Question by:joely
1 Comment
 
LVL 27

Accepted Solution

by:
kretzschmar earned 40 total points
ID: 1343324
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Loops Section Overview
Suggested Courses

926 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