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. MDI Parent & Child Form

MDI Parent & Child Form

Scheduled Pinned Locked Moved C#
csharp
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.
  • T Offline
    T Offline
    tantja
    wrote on last edited by
    #1

    I'm developing a WinForm using C# and VS2005. I was wonder if it is possible to open up a childForm1 in maximize window of MDIparent and launch childForm2 on top of childForm1, but still keep childForm1 as MAXIMIZE. Here's a big picture. childForm1 > childForm2 (childForm1 Maximize and childForm2 on top) What I'm looking for is the code to keep childForm1 maximize and childForm2 launch on top. Please please please please please......advice!!!! Thank you!:~

    M 1 Reply Last reply
    0
    • T tantja

      I'm developing a WinForm using C# and VS2005. I was wonder if it is possible to open up a childForm1 in maximize window of MDIparent and launch childForm2 on top of childForm1, but still keep childForm1 as MAXIMIZE. Here's a big picture. childForm1 > childForm2 (childForm1 Maximize and childForm2 on top) What I'm looking for is the code to keep childForm1 maximize and childForm2 launch on top. Please please please please please......advice!!!! Thank you!:~

      M Offline
      M Offline
      Matthew Butler 0
      wrote on last edited by
      #2

      I don't believe it is possible to have a 'non-maximised' child form over the top of a maximised child form. Setting TopLevel to true throws an error so the only way I can see for you to do it is to resize the child form to the size of the Mdi area (not maximised)... This will allow you to have the other child form(s) over the top of it. You may need to bring the other forms 'tofront' (.BringToFront) if the background form is clicked otherwise all front forms will be hidden. Alternatively... you can put other controls (buttons, labels etc) directly onto a MdiParent form: so if you only want one 'maximised' form... don't actually make it a form, make it a panel (for example) and put all other controls into this. The panel will not be 'allowed' to come forward as it is part of the MdiForm background. Hope this helps.


      Matthew Butler

      T 1 Reply Last reply
      0
      • M Matthew Butler 0

        I don't believe it is possible to have a 'non-maximised' child form over the top of a maximised child form. Setting TopLevel to true throws an error so the only way I can see for you to do it is to resize the child form to the size of the Mdi area (not maximised)... This will allow you to have the other child form(s) over the top of it. You may need to bring the other forms 'tofront' (.BringToFront) if the background form is clicked otherwise all front forms will be hidden. Alternatively... you can put other controls (buttons, labels etc) directly onto a MdiParent form: so if you only want one 'maximised' form... don't actually make it a form, make it a panel (for example) and put all other controls into this. The panel will not be 'allowed' to come forward as it is part of the MdiForm background. Hope this helps.


        Matthew Butler

        T Offline
        T Offline
        tantja
        wrote on last edited by
        #3

        Thanks for your reply. I came up with another idea....but still need a little guidance. Okay, so if my childForm1 is maximize then i launch Form1 by itself, not in MDIParent(frmParent) and if I want to launch childForm2 from Form1 but make it in MDIParent, Maximize and close childForm1. Is it possible? frmChild2 Child2 = new frmChild2(); frmParent Parent = new frmParent(); Child2.MdiParent = frmParent.MdiParent; Child2.WindowState = FormWindowState.Maximized; Child2.Show(); foreach (Form childForm in frmParent.MdiParent.MdiChildren) { if (childForm != Child2) childForm.Close(); } break; But it didn't work.

        M 1 Reply Last reply
        0
        • T tantja

          Thanks for your reply. I came up with another idea....but still need a little guidance. Okay, so if my childForm1 is maximize then i launch Form1 by itself, not in MDIParent(frmParent) and if I want to launch childForm2 from Form1 but make it in MDIParent, Maximize and close childForm1. Is it possible? frmChild2 Child2 = new frmChild2(); frmParent Parent = new frmParent(); Child2.MdiParent = frmParent.MdiParent; Child2.WindowState = FormWindowState.Maximized; Child2.Show(); foreach (Form childForm in frmParent.MdiParent.MdiChildren) { if (childForm != Child2) childForm.Close(); } break; But it didn't work.

          M Offline
          M Offline
          Matthew Butler 0
          wrote on last edited by
          #4

          I'm not 100% sure what you mean... can you be a bit more descriptive/specific? Are you saying you want one MdiParent with child forms that can access each other? (Close each other etc)?


          Matthew Butler

          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