永发信息网

Vb一个小问题

答案:1  悬赏:60  手机版
解决时间 2021-04-22 03:45
  • 提问者网友:抽煙菂渘情少年
  • 2021-04-21 06:01

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
Dim deng As RECT
Dim ss As Boolean

-----------------------

Private Sub Command1_Click()
If ss = True Then
deng.left = 0: deng.top = 0
deng.right = 0: deng.bottom = 0
clipcursor ByVal 0&: ss = False
Else
clipcursor ByVal 0&: ss = True
End If
End Sub

----------------------------

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
ss = True
Command1.Caption = "点击此处锁定鼠标"
Command2.Caption = "结束程序"
Form1.Caption = "锁定鼠标工具 by Erevus"

End Sub
我这源码有错的地方 谁能帮我改一下

最佳答案
  • 五星知识达人网友:你哪知我潦倒为你
  • 2021-04-21 07:02

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


Dim deng As RECT
Dim ss As Boolean


Private Sub Command1_Click()
If ss = True Then
deng.left = 0: deng.top = 0
deng.right = 0: deng.bottom = 0
ClipCursor deng
ss = False
Else
ClipCursor ByVal 0&
ss = True
End If
End Sub


Private Sub Command2_Click()
End
End Sub


Private Sub Form_Load()
ss = True
End Sub


'


'把以上代码直接复制到窗体中,然后添加2个按钮

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯