M
Matthias Hess
I am working on an MDI App. I want the Application to behave like Visual
Studio when the user closes the MDI Parent form.
Let me give you two examples how the application should work:
Example A
1. The user has opened the application, which displays a MDIParent ("MAIN")
form which contains two MDIChild Forms ("CHILD_A" and "CHILD_B").
2. Now the user makes some changes in CHILD_A and CHILD_B.
3. The User clicks the red cross in the upper right corner of MAIN.
4. The Application should display ONLY ONE Dialog box, which says that there
are unsaved changes in two windows.
Example B:
1. The user has opened the application, which displays a MDIParent ("MAIN")
form which contains two MDIChild Forms ("CHILD_A" and "CHILD_B").
2. Now the user makes some changes in CHILD_A and CHILD_B.
3. The User clicks the red cross in the upper right corner of CHILD_A.
4. The Application should display a Dialog box, which says that there are
unsaved changes in CHILD_A.
To be able to solve the Problem stated in Example B, I need to handle the
closing event in the child form, no problem. But this Dialog Box also
appears when I run the "Example A". So, in this case I see two dialog boxes
appearing, one from CHILD_A and one from CHILD_B, which is not what I
intend...
I cannot catch the closing event of the parent form BEFORE the child forms
receive their Closing Events. Thus, my child forms have no way of knowing
whether they are in an "Example A" or in an "Example B" case.
Any ideas?
Regards Mat
Studio when the user closes the MDI Parent form.
Let me give you two examples how the application should work:
Example A
1. The user has opened the application, which displays a MDIParent ("MAIN")
form which contains two MDIChild Forms ("CHILD_A" and "CHILD_B").
2. Now the user makes some changes in CHILD_A and CHILD_B.
3. The User clicks the red cross in the upper right corner of MAIN.
4. The Application should display ONLY ONE Dialog box, which says that there
are unsaved changes in two windows.
Example B:
1. The user has opened the application, which displays a MDIParent ("MAIN")
form which contains two MDIChild Forms ("CHILD_A" and "CHILD_B").
2. Now the user makes some changes in CHILD_A and CHILD_B.
3. The User clicks the red cross in the upper right corner of CHILD_A.
4. The Application should display a Dialog box, which says that there are
unsaved changes in CHILD_A.
To be able to solve the Problem stated in Example B, I need to handle the
closing event in the child form, no problem. But this Dialog Box also
appears when I run the "Example A". So, in this case I see two dialog boxes
appearing, one from CHILD_A and one from CHILD_B, which is not what I
intend...
I cannot catch the closing event of the parent form BEFORE the child forms
receive their Closing Events. Thus, my child forms have no way of knowing
whether they are in an "Example A" or in an "Example B" case.
Any ideas?
Regards Mat