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 Forms From Hell

MDI Forms From Hell

Scheduled Pinned Locked Moved C#
question
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.
  • A Offline
    A Offline
    antoine orchus tech
    wrote on last edited by
    #1

    Hi! I want to make an MDI application. I want the Parent form (frmMain to hold a menu and a Panel (docked top). And I want the MDIChild Forms to be encased, but below the Panel. How do I do that ? Thanks! and cheers :) Antoine This by our hands that dream, "I shall find a way or make one!"

    B 1 Reply Last reply
    0
    • A antoine orchus tech

      Hi! I want to make an MDI application. I want the Parent form (frmMain to hold a menu and a Panel (docked top). And I want the MDIChild Forms to be encased, but below the Panel. How do I do that ? Thanks! and cheers :) Antoine This by our hands that dream, "I shall find a way or make one!"

      B Offline
      B Offline
      bneacetp
      wrote on last edited by
      #2

      antoine@orchus-tech wrote: I want to make an MDI application. I want the Parent form (frmMain to hold a menu and a Panel (docked top). And I want the MDIChild Forms to be encased, but below the Panel. How do I do that ? 1. Make frmMain a MDI form by changing its IsMDIContainer property to true. 2. Add or "drag" a panel from the Toolbox to frmMain form in the form designer and then change its Dock property to Top. 3. Add or "drag" a menu from the Toolbox to frmMain. 4. Make sure that you have a form added to your project for the MDIChild window. 5. Depending on how you want to handle your child window creation, these steps may vary. If you will be implementing a "New" command, then in its event handler in the frmMain class, type (frmChild should be replaced with whatever name you named your child form): line 1: frmChild child = new frmChild(); line 2: child.MdiParent = this; line 3: child.Show(); 6. If you want things to be a little nicer, add a member variable to your frmMain class, possibly by the name of "childCount" of the uint type. Then between lines 2 and 3 from above, type: line 3: childCount += 1; line 4: child.Text = "Document " + childCount.ToString(); Please note that the line numbers above are there merely for reference only. After performing these steps, you should have the beginning workings of an MDI App. Hope this helps. :) Happy Programming and God Bless! Internet::WWW::CodeProject::bneacetp

      A 1 Reply Last reply
      0
      • B bneacetp

        antoine@orchus-tech wrote: I want to make an MDI application. I want the Parent form (frmMain to hold a menu and a Panel (docked top). And I want the MDIChild Forms to be encased, but below the Panel. How do I do that ? 1. Make frmMain a MDI form by changing its IsMDIContainer property to true. 2. Add or "drag" a panel from the Toolbox to frmMain form in the form designer and then change its Dock property to Top. 3. Add or "drag" a menu from the Toolbox to frmMain. 4. Make sure that you have a form added to your project for the MDIChild window. 5. Depending on how you want to handle your child window creation, these steps may vary. If you will be implementing a "New" command, then in its event handler in the frmMain class, type (frmChild should be replaced with whatever name you named your child form): line 1: frmChild child = new frmChild(); line 2: child.MdiParent = this; line 3: child.Show(); 6. If you want things to be a little nicer, add a member variable to your frmMain class, possibly by the name of "childCount" of the uint type. Then between lines 2 and 3 from above, type: line 3: childCount += 1; line 4: child.Text = "Document " + childCount.ToString(); Please note that the line numbers above are there merely for reference only. After performing these steps, you should have the beginning workings of an MDI App. Hope this helps. :) Happy Programming and God Bless! Internet::WWW::CodeProject::bneacetp

        A Offline
        A Offline
        antoine orchus tech
        wrote on last edited by
        #3

        Hi! THis is what I first did. But the child can move 'under' the panel, as though it did not exist. Also, when you max the child, its min-max box goes way up there under the parents' one, instead of under the panel. Thanks! Antoine This by our hands that dream, "I shall find a way or make one!"

        B 1 Reply Last reply
        0
        • A antoine orchus tech

          Hi! THis is what I first did. But the child can move 'under' the panel, as though it did not exist. Also, when you max the child, its min-max box goes way up there under the parents' one, instead of under the panel. Thanks! Antoine This by our hands that dream, "I shall find a way or make one!"

          B Offline
          B Offline
          bneacetp
          wrote on last edited by
          #4

          Oh... The behaviors that you described are default to Windows MDI apps. You could remove those buttons from your MDI Child and put a button or some other UI on your panel to handle the close, min, and max events. As far as constraining the child's movement, you could do calculations to find the size of the parent window and then calculate how much the top area (titlebar, menubar, panel) takes up. Then constrain the children forms using that info. I hope this helps. Happy Programming and God Bless! Internet::WWW::CodeProject::bneacetp

          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