Close Child Forms

  • Thread starter Thread starter Rudolf Ball
  • Start date Start date
R

Rudolf Ball

Hi NG,

i have a question: imagine I have a Main-Form that opens on click other
forms (modal, not modal, messagebox, ). These other forms can open forms,
too. So a Form-tree arises. My question is: how can I close ALL Forms out of
my Main-Form? What possibilities are there to access a Child-Form? And is a
form that I create out of my Main-Form with this code

Form2 x = new Form2();
x.Show();

a Child or not?


Thank you very much

Rudi
 
If your main form is a MDI form you can then check the MDIChildren array.
Let me know if you want me to post some code for this.
 
No, its not a MDI form. Ist a "normal" form

Deepak said:
If your main form is a MDI form you can then check the MDIChildren array.
Let me know if you want me to post some code for this.

--
Deepak

#*#*#*#*#*#*#*#*#*#
I code therefore I am

out is
 
..NET doesn't provide any automatic way to do this (it tries to be good
OO in terms of information hiding). You'll have to manually keep lists
of the forms you want to close later, probably using ArrayList.
 
Back
Top