How do I do this?
Printable View
How do I do this?
Use the GetCursorPos() API function. Or find a mouse event that does what you want and the coordinates will be handed to you in the event.
The D3D Device also gives you a CursorPos function, something like D3DDevice.GetCursorPos(...).
Z.
Add two labels, Name them "label1" and label2" Now add a timer control and set its interval to 1.
Use the following code now:
Have Fun!:DCode:
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim pos As POINTAPI
Private Sub Timer1_Timer()
GetCursorPos pos
Label1.Caption = "X:" & pos.x
Label2.Caption = "Y:" & pos.y
End Sub