前端之家收集整理的这篇文章主要介绍了
vb Postmessage后台模拟点击句柄控件指定坐标位置,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
vb Postmessage
后台模拟点击句柄控件指定坐标位置
Private Sub Command1_Click()
Picture1.Cls
ClickHwndByXy Picture1.Hwnd,20,20
End Sub
Private Sub Form_Load()
'窗体上添加一个按钮控件和图片框控件就可以了
Picture1.DrawWidth = 25
Picture1.ForeColor = vbRed
End Sub
Private Sub Picture1_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
Picture1.PSet (X,Y)
If Button = 1 Then
MsgBox "坐标被点击:" & X & "--" & Y & ",像素:" & X / Screen.TwipsPerPixelX & "," & Y / Screen.TwipsPerPixelY
End If
End Sub
原文链接:https://www.f2er.com/vb/260990.html