Put this code in the MouseMove event of the Form.
Code:Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Cls
Print X & "," & Y
End Sub
Printable View
Put this code in the MouseMove event of the Form.
Code:Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Cls
Print X & "," & Y
End Sub
Here's some api for getting the position (in pixels) wherever you cursor is, just put a timer on your form and it's interval to something
Code:Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Timer1_Timer()
Dim pa As POINTAPI
GetCursorPos pa
pa.x = -pa.x: pa.y = -pa.y
ClientToScreen hwnd, pa
pa.x = -pa.x: pa.y = -pa.y
Caption = pa.x & "," & pa.y
End Sub