vb 锁定鼠标到某一位置

前端之家收集整理的这篇文章主要介绍了vb 锁定鼠标到某一位置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Sub Command1_Click() '锁定鼠标 到某一位置
Dim r As RECT
r.Left = 100: r.Top = 100
r.Right = 100: r.Bottom = 100
ClipCursor r
End Sub

Private Sub Command2_Click() '解除锁定
ClipCursor ByVal 0&
End Sub

'原帖地址:

http://fy5388.blog.163.com/blog/static/5649953720091127115554104/

猜你在找的VB相关文章