How to declare/tie a mdigrandchild form to mdiGrandParent form?
-
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.
-
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.
I am not sure that I totally understand your question, but I think that you want the grandchild form to be bound within the parent form? If that is so, just set the grandchild forms'
mdiparent
property to the parent form as well.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
I am not sure that I totally understand your question, but I think that you want the grandchild form to be bound within the parent form? If that is so, just set the grandchild forms'
mdiparent
property to the parent form as well.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
I would but what is the method if I can't use: The parent is MainIndiv_Truck_ControlMDI : Form the child1 is declared inside the parent as: child1 = Indiv_Truck_Control TruckForm = new Indiv_Truck_Control(); TruckForm.MdiParent = this; Then child1 spawns a child of its own, grandchild. The grandchild has to be inside the MainIndiv_Truck_ControlMDI : Form. grandchild.Mdiparent = "what"? I'm not sure how to say the "what"? part. Thanks
-
I would but what is the method if I can't use: The parent is MainIndiv_Truck_ControlMDI : Form the child1 is declared inside the parent as: child1 = Indiv_Truck_Control TruckForm = new Indiv_Truck_Control(); TruckForm.MdiParent = this; Then child1 spawns a child of its own, grandchild. The grandchild has to be inside the MainIndiv_Truck_ControlMDI : Form. grandchild.Mdiparent = "what"? I'm not sure how to say the "what"? part. Thanks
For the grandchild form to be contained inside the grandparent form it must be
grandchild.Mdiparent = MainIndiv_Truck_ControlMDI
otherwise it won't be contained. You can put a form inside another, but you won't get the benefits of the MDI interface. Like this:Form grandchild = new grandchildForm(); grandchild.TopLevel = false; grandchild.Parent = MainIndiv\_Truck\_ControlMDI; grandchild.Visible = true; grandchild.Location = new Point(10, 10); grandchild.Size = new Size(100, 150); grandchild.BackColor = Color.Bisque; // or whatever. this is just to make it stand out MainIndiv\_Truck\_ControlMDI.Controls.Add(grandchild);
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”