M
MuZZy
Hi,
For example, I have an MDI application with two MDI child forms: one
called "Menu" and one called "Data". "Menu" form has Menu_Closing()
event handler for "Closing" event where it checks if "Data" form exists
and if yes, it closes it.
Something like this:
private void Menu_Closing(object sender, CancelEventArgs e)
{
if (DataForm != null)
DataForm.Close();
}
Now, i need to add the following thing to the application: when you
close the MDI parent screen it shoudl ask you to confirm closing. smth
like "Do you reall want to close the app?", so i do it in MDIParent's
closing event handler. But here's the problem: when i click "X" to close
MDI Parent screen it first tries to close all MDI child screens even
before firing MDIParent_Closing, so Menu_Closing() gets fired and "Data"
form gets closed and only after that i get the message asking if i want
to close the application, which is of course unacceptable.
Any ideas how to overcome the problem?
Thank you in advance!
MuZZy
For example, I have an MDI application with two MDI child forms: one
called "Menu" and one called "Data". "Menu" form has Menu_Closing()
event handler for "Closing" event where it checks if "Data" form exists
and if yes, it closes it.
Something like this:
private void Menu_Closing(object sender, CancelEventArgs e)
{
if (DataForm != null)
DataForm.Close();
}
Now, i need to add the following thing to the application: when you
close the MDI parent screen it shoudl ask you to confirm closing. smth
like "Do you reall want to close the app?", so i do it in MDIParent's
closing event handler. But here's the problem: when i click "X" to close
MDI Parent screen it first tries to close all MDI child screens even
before firing MDIParent_Closing, so Menu_Closing() gets fired and "Data"
form gets closed and only after that i get the message asking if i want
to close the application, which is of course unacceptable.
Any ideas how to overcome the problem?
Thank you in advance!
MuZZy