Little Red 'X' on MDI
-
When The RED X on the parent form is pressed, what is run? It seems like the child form_Closing runs prior to the Parent form_Closing event. I need to capture the X press before it does ANYTHING... including kill the child form. Any ideas? Thanks ***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW -- modified at 11:12 Friday 21st October, 2005
-
When The RED X on the parent form is pressed, what is run? It seems like the child form_Closing runs prior to the Parent form_Closing event. I need to capture the X press before it does ANYTHING... including kill the child form. Any ideas? Thanks ***************** "We need to apply 21st-century information technology to the health care field. We need to have our medical records put on the I.T." —GW -- modified at 11:12 Friday 21st October, 2005
Add this simple code to your main form class:
protected override void OnClosing(CancelEventArgs cea) { if (there are any MDIs) cea.Cancel = true; else base.OnClosing(cea); // not necessary, but nice }
-
Add this simple code to your main form class:
protected override void OnClosing(CancelEventArgs cea) { if (there are any MDIs) cea.Cancel = true; else base.OnClosing(cea); // not necessary, but nice }