Add two labels (Label1 , Label2) and a timer (Timer1).

VB Code:
  1. Option Explicit
  2.  
  3. Private Type POINTAPI 'Declare types
  4.     x As Long
  5.     y As Long
  6. End Type
  7.  
  8. Private Declare Function GetCursorPos Lib "user32" _
  9. (lpPoint As POINTAPI) As Long 'Declare API
  10.  
  11. Dim z As POINTAPI 'Declare variable
  12.  
  13. Private Sub Form_Load()
  14.  Timer1.Interval = 1
  15.  Timer1.Enabled = True
  16. End Sub
  17.  
  18. Private Sub Timer1_Timer()
  19. GetCursorPos z 'Get Co-ordinets
  20. Label1 = "x: " & z.x 'Get x co-ordinets
  21. Label2 = "y: " & z.y 'Get y co-ordinets
  22. End Sub