|
-
May 31st, 2002, 01:35 PM
#1
Thread Starter
Member
Current X and Y Coordinates...
I know this is easy, but I forgotten how to find the X, Y coordinates of the mouse on a form. I thought it was CurrentX, CurrentY... but that doesn't seem to be the case. I have a third party control on my form and I need to know where the user has clicked to know which event to fire... but first I need the mouse coordinates in twips... ScaleMode on the form is set to twips.
Thanks in advanced
Newty
-
May 31st, 2002, 01:37 PM
#2
PowerPoster
Well
VB Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label1.Caption = X & ", " & Y
End Sub
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
May 31st, 2002, 02:47 PM
#3
Fanatic Member
Better is to use the ScreenToClient API.
The 1st parameter is the hWnd property of the Form.
The 2nd parameter is a POINTAPI structure that contains the screen coordinates and after the call it will contain the client's calculated coordinates. (all in pixels)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|