2个回答
展开全部
在通过声明区加入以下代码:
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
加入按钮的CLICK事件
Private Sub Command1_Click()
Dim x As Long ‘想单击区域的X坐标,以像素为单位
Dim y As Long‘想单击区域的Y坐标,以像素为单位
x = 10
y = 10
SetCursorPos x, y
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
加入按钮的CLICK事件
Private Sub Command1_Click()
Dim x As Long ‘想单击区域的X坐标,以像素为单位
Dim y As Long‘想单击区域的Y坐标,以像素为单位
x = 10
y = 10
SetCursorPos x, y
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
微测检测
2023-10-30 广告
2023-10-30 广告
深圳市微测检测有限公司始创于2005年,是一家综合性、全方位、一站式的权威第三方检测认证公司。自成立以来,Microtest微测检测已成功为上万家企业完成数十万计的产品测试和认证,协助企业的产品畅销全球。Microtest微测检测已建立二十...
点击进入详情页
本回答由微测检测提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询