![]() But all other windows including the main act like nothing happened. The form showing the prompt reacts correctly (if they hit Cancel it remains open, if not, it closes normally). It doesn't matter what they clicked, either. ![]() Once a button is clicked, it is processed as normal, but all other windows either discard or disregard the window close command. ![]() If I prompt the user using a standard MessageBox.Show command, then the closing event pauses while the dialog is waiting for a user response. The problem is that each other window checks for changes and prompts and then the main window attempts to close other windows. This command seems to send a close message to all windows. This appears in 7's new taskbar as well as XP/Vista when grouping is active (though then it is labeled "Close Group"). This logic occurs in the FormClosing events and works great except if the user uses the taskbar's "Close all windows" command. user clicked Cancel), then it stops the closing event. When the main window is closed, it attempts to first close all other open windows. When an other window is closed, it checks for unsaved changes and prompts the user with a standard Save/Don't save/Cancel Microsoft Word style prompt. That's fine, but because the user may have unsaved work in the other opened windows I implemented some form closing logic. However, the default behavior is if the main window closes then the application closes due to the Application.Run method returning. The other open windows are not owned by the main window nor are they modal dialogs or anything. I have a Windows Forms app with a main window and 0 or more other windows open.
0 Comments
Leave a Reply. |