如何用vb编鼠标光标消失,即vb编出的程序没有鼠标光标

来源:百度知道 编辑:UC知道 时间:2024/06/18 04:08:35
在程序里没有,在程序之外就有光标

Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointApi) As Long
Private Type PointApi
x As Long
y As Long
End Type
Dim a As PointApi
Private Sub Form_Load()
Timer1.Interval = 10
End Sub

Private Sub Form_Unload(Cancel As Integer)
ShowCursor 1
End Sub

Private Sub Timer1_Timer()
Dim xx As Boolean
Call GetCursorPos(a)
If a.x * 15 > Me.Left And a.y * 15 > Me.Top And a.x * 15 < Me.Left + Me.Width And a.y * 15 < Me.Top + Me.Height Then
If xx = False Then ShowCursor False: xx = True
Else
ShowCursor True
xx = False
End If
End Sub

Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Private Sub Form_Load()
ShowCursor 0 '0:hide '1:show
End Sub