home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "Form1"
- ClientHeight = 2685
- ClientLeft = 135
- ClientTop = 5115
- ClientWidth = 3375
- Height = 3090
- Left = 75
- LinkTopic = "Form1"
- ScaleHeight = 2685
- ScaleWidth = 3375
- Top = 4770
- Width = 3495
- Begin CommandButton Command1
- Caption = "HideCursor"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 18
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 1995
- Left = 720
- TabIndex = 0
- Top = 720
- Width = 2655
- End
- Option Explicit
- Declare Function ShowCursor% Lib "User" (ByVal bShow%)
- Sub Command1_Click ()
- 'All thanks goes to MikeStanly that have written me a similar example
- 'to hide the mouse cursor. He has also written an article example on
- 'how to use custom cursors for the Visual Basic Programmer's Journal.
- 'You can download that file here on AOL called CURSOR.ZIP
- '
- '
- 'Certain applications when load, will call this function more than once.
- 'and Windows will maintain an internal count that is incremented for each
- 'call of this function if bShow is True or decremented if bShow is False.
- 'The cursor is displayed if the Windows count is greater or equal to 0, and
- 'hidden if its less than 0. so if you have tried using this function before
- 'and doesn't work 100% of the time. Then you should always use a loop with this
- 'function inorder to guaranteed it to work the way you expect it to.
- If Command1.Caption = "HideCursor" Then
- Do While ShowCursor(False) > 0: Loop
- Cls
- Print ShowCursor(False)
- Command1.Caption = "ShowCursor"
- Else
- Do While ShowCursor(True) < 0: Loop
- Cls
- Print ShowCursor(True)
- Command1.Caption = "HideCursor"
- End If
- '
- '
- End Sub
-