Limiting window movement
-
Background of my goal: I've been asked to simulate a mdi in a mdi to do this i'm trying to limit a user from moving a form beyond the bounds of what will be considered the a main form (keep in mind the parent is not mdi just and owner and it has to be that way) My desire: I want limit a windows movement to an area i set in code. I been able to do this by set the location property when it hits a boundary but this causes a lot of flicking. I tried setting the capture property to false but that then the form snaps back to its orginal position before the move. So thats where i am. I either want to be able to stop the form from flicking or stop it from snapping back the orginal position. any help is greatly appreciated.
-
Background of my goal: I've been asked to simulate a mdi in a mdi to do this i'm trying to limit a user from moving a form beyond the bounds of what will be considered the a main form (keep in mind the parent is not mdi just and owner and it has to be that way) My desire: I want limit a windows movement to an area i set in code. I been able to do this by set the location property when it hits a boundary but this causes a lot of flicking. I tried setting the capture property to false but that then the form snaps back to its orginal position before the move. So thats where i am. I either want to be able to stop the form from flicking or stop it from snapping back the orginal position. any help is greatly appreciated.
I've never tried to keep a window position from going too far to the top or the left, but the WM_GETMINMAXINFO message and the related MINMAXINFO structure were designed to limit sizing and maximized window positioning. Check that out. It may be the solution you need. John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.