Hide the Cursor

  • Thread starter Thread starter DS
  • Start date Start date
Hi DS,

If you're talking about textboxes on Microsoft Access forms, and want to
hide the flashing insertion point, you can set the textbox's Locked
property to True and its Enabled property to False.
 
There's also this way. 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
 
Graham said:
There's also this way. 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
Great Thanks..
Will this reshow the cursor when you go to another form?
DS
 
John said:
Hi DS,

If you're talking about textboxes on Microsoft Access forms, and want to
hide the flashing insertion point, you can set the textbox's Locked
property to True and its Enabled property to False.
Thanks....I need the box to enabled though, because its on a subform
that I'm adding records to. I just want the cursor to stop flashing
since I'm choosing from a listbox,
DS
 
No, it won't. It will only show the cursor when the first form unloads. If
at any time, you want to show the cursor, cal ShowPointer().

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Back
Top