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. From as both MDIContainer and MDIChild

From as both MDIContainer and MDIChild

Scheduled Pinned Locked Moved C#
c++csharpquestion
5 Posts 3 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.
  • D Offline
    D Offline
    DVryce
    wrote on last edited by
    #1

    Is there a way to make a form show up as both an MDIChild and an MDIContainer? That is to have a top level window with sub-windows each of which has it's own sub-windows? I managed this once in C++ with MFC through a method much to complicated to describe here, but I'm totally new to C# and wondering if this is possible?

    N J 3 Replies Last reply
    0
    • D DVryce

      Is there a way to make a form show up as both an MDIChild and an MDIContainer? That is to have a top level window with sub-windows each of which has it's own sub-windows? I managed this once in C++ with MFC through a method much to complicated to describe here, but I'm totally new to C# and wondering if this is possible?

      N Offline
      N Offline
      Neill Jordan
      wrote on last edited by
      #2

      I just did a quick test and the following exception was thrown - System.Exception: A form can't be both an MDI child and MDI parent. So, if it is possible, it isn't done in the most obvious way. Maybe there is a complicated workaround?

      D 1 Reply Last reply
      0
      • N Neill Jordan

        I just did a quick test and the following exception was thrown - System.Exception: A form can't be both an MDI child and MDI parent. So, if it is possible, it isn't done in the most obvious way. Maybe there is a complicated workaround?

        D Offline
        D Offline
        DVryce
        wrote on last edited by
        #3

        Neill Jordan wrote: I just did a quick test and the following exception was thrown - System.Exception: A form can't be both an MDI child and MDI parent. So, if it is possible, it isn't done in the most obvious way. Yeah, I did get this far... Thanks for the attempt though. It sure as hell wasn't easy under MFC so it probably isn't easy this time around either. I guess this is a good indication that I should rethink my GUI design! :-D

        1 Reply Last reply
        0
        • D DVryce

          Is there a way to make a form show up as both an MDIChild and an MDIContainer? That is to have a top level window with sub-windows each of which has it's own sub-windows? I managed this once in C++ with MFC through a method much to complicated to describe here, but I'm totally new to C# and wondering if this is possible?

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          Here's some naming so I don't get confused while I'm typing this. MDIParent - MDIChild   - MDIGrandchild On the MDIChild add a panel and set the dock style to fill; you may want to set the backcolor so it isn't the control color. On the MDIGrandchild set the TopMost property to false, then add the MDIGrandchild to MDIChild's panel's control collection. You'll probably have to add some logic for scroll bars and the Windows menu on the MDIChild, but that should work visually. HTH, James [edit, fixed my naming chart so it didn't look like both were children were directly from parent]

          1 Reply Last reply
          0
          • D DVryce

            Is there a way to make a form show up as both an MDIChild and an MDIContainer? That is to have a top level window with sub-windows each of which has it's own sub-windows? I managed this once in C++ with MFC through a method much to complicated to describe here, but I'm totally new to C# and wondering if this is possible?

            J Offline
            J Offline
            James T Johnson
            wrote on last edited by
            #5

            My bad, its not the TopMost property, its the TopLevel property. Guess thats what I get when I guess which of the two it was :P James

            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