vb怎么限定鼠标的移动范围?
1个回答
展开全部
Option Explicit
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Option Explicit
‘限制鼠标的移动区域
Private Sub Command1_Click()
Dim r As RECT
r.Left = 0: r.Top = 0
r.Right = 320: r.Bottom = 200
ClipCursor r
End Sub
‘取消限制鼠标的移动区域
Private Sub Command2_Click()
ClipCursor ByVal 0&
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询