Detect (x,y) of the mouse pointer

D

Diane

On a form I would like to place the mouse and click - then
the coordinates of the mouse should be used in my on-click
event for the form.

How do I get the (x,y) of the mouse pointer?
 
B

Bill Mitchell

But if the MouseDown event is in a control, it returns the X,Y coordinates
inside that control and not on the form. How does this work if I click on a
control and want to know the XY Coordinates on the form and not within the
control?

Bill
 
A

Andi Mayer

But if the MouseDown event is in a control, it returns the X,Y coordinates
inside that control and not on the form. How does this work if I click on a
control and want to know the XY Coordinates on the form and not within the
control?

the control has a .Left and a .Top, if you add it to X and Y you will
get it

If you expect an answer to a personal mail, add the word "manfred" to the first 10 lines in the message
MW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top