Close Child Forms

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
 
D

Deepak

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.
 
R

Rudolf Ball

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
 
J

Joe White

..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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top