I have an MDI form containing child forms. I want to handle form closing to
display a confirmation message when a form is closed or when the main form
is closed. However, the Closing even of the child forms is raised before the
Closing event of the MDI form when you close the MDI form. So, if I catch
the Closing event of the child forms and display a message, then catch the
Closing even of the main form, then I get 2 messages displayed.
Is there a way to know, when a child form is being closed, wether the user
closed the child form or the mdi form?
Thanks
Etienne
Haim - 28 Sep 2004 09:17 GMT
The only way I can think of right now is to catch the
MouseDown event of the parent window and check to see if
the mouse position is over the close button, if it is -
you can ask for approval and disable the event if the
user choose to cancel the form close.
I am sure there is a better way but at least it gives you
a full solution.
Haim.
>-----Original Message-----
>I have an MDI form containing child forms. I want to handle form closing to
[quoted text clipped - 11 lines]
>
>.
Wiktor Zychla - 28 Sep 2004 09:29 GMT
>I have an MDI form containing child forms. I want to handle form closing to
>display a confirmation message when a form is closed or when the main form
[quoted text clipped - 5 lines]
> Is there a way to know, when a child form is being closed, wether the user
> closed the child form or the mdi form?
http://tinyurl.com/5e4c9
Wiktor Zychla