I have an MDI application where multiple child windows may be open. If the user elects to close the application (from an Exit menu or the "X") I need to show him each child window with unsaved data and ask him to confirm he wants to that window. If he says Yes, I need to close that window; if he says No, then all remaining child windows are to remain open and the exit aborts.
I can pop up the confirmation question in FormClosing on the child window, but if the user answers Yes, the system leaves that window open and prompts for the next window. If the user answers No to that one, the exit aborts, but both windows are still open. Looks like the MDI window runs through FormClosing for all child windows before actually closing any of them.
Do I need to write my own method on the MDI form to cycle through the MDI children? If so would I call the MDI child's Close method, and set the Cancel flag on the FormClosingEventArgs to True if the user chooses not to close? Is there a better or more standard way to handle this?
mamacasc