Restrict mouse movement to a specific region in Access 97

  • Thread starter Thread starter David
  • Start date Start date
D

David

Could someone help with the following:-



I have a form that under certain conditions (when I call the code) I would
like to restrict the mouse to a rectangle box. (shp_P_RectBox)

Is this possible in ACC97. Any code examples would be most helpful.

Thank you
 
Hi,

You can use ClipCursor. See examples from AllAPI at http://www.mentalis.org/

Once you have the Rectangle of the application Window ( GetWindwoRect ),
specify this rectangle in ClipCursor. Use:

Call ClipCursor(ByVal vbNullString)


to remove the restriction.



Hoping it may help,
Vanderghast, Access MVP
 
Thank you for the reply.

I now have some code working that will restrict the mouse to a form,
however as per my request for help, I would like to restrict the mouse
movement down to a given area say the bottom quarter of the left hand side
of a form, if it is not possible to restrict it to within a rectangle of an
object.

As I am unclear of the next move any help would be most appreciated.
 
Hi,


Any rectangle can be used. You can use :



with myRectangle
.top = (.top + .bottom) /2
.left=(.left+.right)/2
end with

ClipCursor myRectangle


( and use a timer that fires to restore the ClipCursor to its default...
just in case you paint yourself in a strange corner...)



Hoping it may help,
Vanderghast, Access MVP.
 
Back
Top