7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
'【操作系统】
'Win9X: Yes
'WinNT: Yes
'【说明】
' 控制鼠标指针的可视性
'【返回值】
' Long,显示计数(参考注解)
'【其它】
' windows维持着一个内部显示计数;倘若bShow为TRUE,那么每调用一次这个函数,计数就会递增1;反之,如bShow为FALSE,则计数递减1。只有在这个计数大于或等于0的情况下,指针才会显示出来
'【参数表】
' bShow ---------- Long,TRUE(非零)显示指针,FALSE隐藏
Private Sub Command1_Click()
Dim intP As Integer
If Command1.Caption = "隐藏鼠标" Then
intP = ShowCursor(False) '隐藏鼠标
Command1.Caption = "显示鼠标"
Else
intP = ShowCursor(True) '显示鼠标
Command1.Caption = "隐藏鼠标"
End If
End Sub