Hide Cursor

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I developed an application that uses a touch screen. The mouse/cursor is
never used. Can I hide the Cursor on startup of this application? or at least
park it out of the way?
 
Richard,

Add the following to a module:

Public Declare Function ShowCursor Lib "user32" _
(ByVal bShow As Long) As Long

Public Sub ShowPointer()
Do While ShowCursor(1) < 0
DoEvents
Loop
End Sub

Public Sub HidePointer()
Do While ShowCursor(0) >= -1
DoEvents
Loop
End Sub

Then create an unbound form that has the following code in its Load and
Unload events:

Private Sub Form_Load()
HidePointer
End Sub

Private Sub Form_Unload()
ShowPointer
End Sub

Finally, create a macro called "AutoExec". Add an OpenForm action that opens
the form you just created, and make sure the WindowMode = Hidden.

The above will load the hidden form when the application starts. Loading the
form will hide the cursor. When the application closes, the hidden form will
unload, and show the cursor again.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
That does it...

My application opens the first user form via AutoExec, so I put your Load
and Unload function calls there. Many thanks...
 
Back
Top