Restrict mouse movement to a specific region in Access 97

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
 
M

Michel Walsh

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
 
D

David

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.
 
M

Michel Walsh

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top