2
Answers

How to declare/tie a mdigrandchild form to mdiGrandParent form?

Photo of N

N

16y
4.8k
1

How to declare/tie a mdigrandchild form to mdiGrandParent form?

Situ:
I'm writing some code/mdiParent that spawns a child form, child1, that has all the information capturing. Now child1 spawns a child, grandchild. The grandchild is a lean version of child1, readonly type situation. Child1 is not shown, but working. Grandchild is to: Grandchild.show().

Needed:
I need to declare the grandchild to show in the mdiParent. I'm sure it's somthing similar to :

The parent is MainIndiv_Truck_ControlMDI : Form

the child1 is declared in the parent as:

Indiv_Truck_Control TruckForm = new Indiv_Truck_Control();
TruckForm.MdiParent = this.

I know I'm missing something. I can make the grandchildren, but there happening outside the MdiParent. I want them to happen inside MainIndiv_Truck_ControlMDI : Form

Thanks in advance.
L.

Answers (2)

0
Photo of N
NA 15 0 16y

I tried:

TruckForm.MdiParent = Application.OpenForms["MainIndiv_Truck_ControlMDI"];

There's no error but grandchildren are still outside MainIndiv_Truck_ControlMDI

I know it's something simple.  I'm still a little new to C#, I ain't got all the tools down yet.

N.

0
Photo of Ryan Alford
NA 1.7k 1.7m 16y
grandChildForm.MdiParent = Application.OpenForms["YourMDIParentFormName"];