C
Charles Law
In an MDI app, I want to warn users when they attempt to close any of the
MDI child windows, and give them the option to cancel the close. I put code
in the Closing event of the child form to display a prompt.
The problem is, when I close the application, the prompt is displayed for
every child window as it closes, although the warning is not appropriate at
this time.
I thought it would be possible to determine why a form was closing, e.g.
because Windows is shutting down, or the user clicked the close button, etc.
Is there a better/more appropriate way to do this? I am reluctant to start
including parameters that get set and reset depending on who clicked what
and when.
TIA
Charles
MDI child windows, and give them the option to cancel the close. I put code
in the Closing event of the child form to display a prompt.
The problem is, when I close the application, the prompt is displayed for
every child window as it closes, although the warning is not appropriate at
this time.
I thought it would be possible to determine why a form was closing, e.g.
because Windows is shutting down, or the user clicked the close button, etc.
Is there a better/more appropriate way to do this? I am reluctant to start
including parameters that get set and reset depending on who clicked what
and when.
TIA
Charles