"Sha Crawford" <sh**********@h otmail.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
How do I hide the mouse pointer in a particular MS Access form?
Thanks.
Sha Crawford
www.sha-crawford.co.uk
Hiding the cursor may be a bit annoying and unexpected for your users. Have
you looked at opening forms modally so that you can't do anything else until
you've shut that form? For example, you wouldn't be able to move your
cursor to a menu or toolbar or open another form.
If you really need to do it, paste the following into a new module. Then you
could call HideTheCursor when the form opens and ShowTheCursor when it
closes. You could also look at clipping the cursor, where restrict the
mouse to a fixed rectangle using co-ordinates you supply (I have given some
arbitrary values).
' *************** *************** *****
Option Compare Database
Option Explicit
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
Public Sub ClipTheCursor()
Dim rec As RECT
Dim lng As Long
With rec
.Top = 100
.Left = 100
.Bottom = 400
.Right = 400
End With
lng = ClipCursor(rec)
End Sub
Public Sub UnclipTheCursor ()
Dim lng As Long
lng = ClipCursor(ByVa l 0&)
End Sub
Public Sub HideTheCursor()
Call ShowCursor(0)
End Sub
Public Sub ShowTheCursor()
Call ShowCursor(-1)
End Sub
' *************** *************** *****