vb中怎么获取鼠标的坐标
展开全部
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
Dim p As POINTAPI
GetCursorPos p
Cls
Print p.X, p.Y
End Sub
添加一个timer控件,然后贴上代码就可以获取鼠标坐标
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询