MDI form and children form hierarchy

G

Guest

Hello,

Is it possible to create inside MDIForms additional child forms which also
have form children?

For my application it is necessary to create a hierarchy of forms, e.g.

MainMDIForm
Child 1
Child 2
Child 2.1
Child 2.2
Child 2.2.1
Child 3
.....................

It must be possible that on closing of the form Child 2 all children
2.x.x.x close automatically with it.

I have tested the built-in properties Form.MDIParent and Form.Owner.
With "Owner" one can built the hierarchy, but the children are then no
longer "hooked" into the MDI form.
They are actually completely independent and cannot be automatically
graphically arranged anymore.

It seem that there is only an "either - or" solution.
Either directly MDI child using "MDIParent" or form based hierarchy using
"Owner" .

Has anyone better proposal to solve such a problem?


I have a simple idea but I am not sure if this would work.
I could store in my Parent Form Classes a typed ArrayList which contains
links/references to my children forms.
The problem I see is the required manual management for adding new forms,
closing them, deleting them
and releasing all resources using the ArrayList.

Any help is really appreciated

Thank you


Cheers

Carsten
 
J

Jacob

Have you tried:
Form f = new Form();
f.Parent = this;
f.Show();

This sets the present form as the parent of f. I don't know of any
restrictions to running the same code in f for a child form g.
 

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