Click here to Skip to main content
15,911,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

in my Access 2007 project, I would like to keep a "menu" form always open to act as the main switchboard. I am working in the "overlapping windows" setting. The menu form is a popup form, so all other forms disappear when dragged behind the menu.

If a user drags his form too far behind the menu form, so that the dragging portion of the form border is hidden behind the menu, then he will have no chance of retrieving the form. Therefore I would like to have an event that fires after a user has dragged a form and released the mouse. In this event, I could then check whether the form is behind the menu, and reposition it if necessary. Does anyone know how to do this?

I can mimic this behaviour using a timer event running in the background, checking every 100ms whether a form needs to be repositioned. However, this of course keeps running the whole time, even if the user hasn't dragged any form anywhere. Does anyone have an alternative idea avoiding this constant timer running in the background?

It would suffice if I could detect mouse-down, mouse-move and mouse-up events on the border of the form (NOT on the body of the form). However, this does not seem possible directly in Access.
I have experimented setting a windows hook to catch mouse click events to detect the mouse click on the form border. As I am quite clueless regarding subclassing, these attempts failed miserably and my application kept crashing...

I would be grateful for any other ideas.
Cheers, Max
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900