Solved

OnClick event

Posted on 1998-10-19
1
391 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 10 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now