展开全部
需要使用 API 函数,在 VB 中申明如下
Declare Function ClipCursor Lib "user32" (lpRect As RECT) As Long
Declare Function ClipCursorRelease Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long) As Long
Type RECT
Left As Long
Right As Long
Top As Long
Bottom As Long
End Type
RECT 为矩形信息的用户自定义类型,分别表示左边距、右边距和上边距、下边距
限制鼠标在某个范围调用:ClipCursor 函数,传递 RECT 参数(要限制鼠标的范围)
取消限制鼠标调用:ClipCursorRelease 函数,传递 0 即可取消限制
Declare Function ClipCursor Lib "user32" (lpRect As RECT) As Long
Declare Function ClipCursorRelease Lib "user32" Alias "ClipCursor" (ByVal lpRect As Long) As Long
Type RECT
Left As Long
Right As Long
Top As Long
Bottom As Long
End Type
RECT 为矩形信息的用户自定义类型,分别表示左边距、右边距和上边距、下边距
限制鼠标在某个范围调用:ClipCursor 函数,传递 RECT 参数(要限制鼠标的范围)
取消限制鼠标调用:ClipCursorRelease 函数,传递 0 即可取消限制
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询