Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to declare/tie a mdigrandchild form to mdiGrandParent form?

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

Scheduled Pinned Locked Moved C#
tutorialquestionannouncement
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lecutus1
    wrote on last edited by
    #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.

    H 1 Reply Last reply
    0
    • L Lecutus1

      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.

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

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

      L 1 Reply Last reply
      0
      • H Henry Minute

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

        L Offline
        L Offline
        Lecutus1
        wrote on last edited by
        #3

        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

        H 1 Reply Last reply
        0
        • L Lecutus1

          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

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups