Mouse coordinates

hog

Well-known member
Joined
Mar 17, 2003
Messages
984
Location
UK
How do you get the X,Y coords of a mouse click relative to you apps form rather than the entire screen?

When I get the location using Cursor.Position.X and Cursor.Position.Y I get a value way bigger than expected?

Ah, just used this:

Code:
pntMousePos.X = Me.Cursor.Position.X

But what happens is the Me object X return 381 but 769 get assigned to pntMousePox.X??
 
Last edited by a moderator:
This will do it:
Code:
Me.PointToClient(Me.Cursor.Position).ToString()
to string so you can show it in msgbox, textbox or whatever or just remove to string if you dont need to show it
 
Back
Top