Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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:

 


pntMousePos.X = Me.Cursor.Position.X

 

But what happens is the Me object X return 381 but 769 get assigned to pntMousePox.X??

Edited by hog
My website
Guest mutant
Posted

This will do it:

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...