-
MDI forms and ALT F4
I've handled the close event on my MDI child forms so that when the user attempts to close them they just get hidden. The problem I now have is that ALT F4 (which should close the entire application) just hides the MDI child that has the focus. Only when all the children have been hidden does the main application close.
Has anybody got any ideas how I could work round this? I suppose I should really associate a class with each child form to hold its data and reload every time the form is shown. Seems like a lot of work though...
-
The usual way to handle MDI control keys is to have Control-F4 close the focused child window, and Alt-F4 close the parent app regardless of the state of the child windows, although if it's a document editor type you may decide to abort the close or save some data in child windows first. Not sure how you have your event code laid out but I suspect you're using Form.Closing on the main form? If you are then you may want to rethink that.