I have an MDI application with child windows. It's possible for the user to move the child window's title bar up hig开发者_开发知识库h enough so that it is placed underneath the toolbar for the application, and the control box for the window is obscured, making it impossible to close. There is sometimes so little room to "grab" the window and pull it back down that the user has to restart the application altogether. How can I limit the positioning of an MDI child window so that it stops when it bumps up against the bottom of the MDI parent's toolbar?
If that's too confusing, here's the simplified version: how can I constrain the movement of an MDI child form to a certain portion of the screen or parent form?
Register to the MDI child's Move
event and make sure that the Top
is greater than 0.
By the way, when I move a MDI child too high, I get a scrollbar letting me scroll up.
精彩评论