Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) AsLong Private Type POINTAPI ' 声明数据类型 x AsLong y AsLong End Type Dim z As POINTAPI ' 变量 PrivateSub Timer1_Timer() GetCursorPos z ' 获取坐标 Label1.Caption ="x: "& z.x *15 Label2.Caption ="y: "& z.y *15 End Sub