ToolStripContainers and MDI applications

Hi,

I'm creating a simple MDI application and wanted to use the ToolStripContainer component to provide runtime docking features such as VS docking...

However, I couldn't find a way to get rid of the ToolStripContentPanel which is always shown...

I tried to disable it and set its backcolor to transparent but the Mdi Child Forms are always behind this control...
Any ideas

Thanks,

Amadrias


Answer this question

ToolStripContainers and MDI applications

  • CHowell

    If the ToolStripContainer and SplitContainer forms are going to be the supported method for laying out child windows in .NET, then the implementation of the MdiClient class really needs to be updated to coexist with these gracefully. The MdiClient window needs to be able to interact with the menu of the top level form without imposing the requirement that it must be an immediate child. This way the MdiClient window could participate in layout hierarchies just like any other form: it could be a pane in a SplitContainer, inside a SplitContainer inside a ToolStripContainer for example, or appear as child window of a tab control.

    However, the MdiClient class is sealed (and seems to be a thin wrapper around the MDI functions built in to Windows), so fixing this behavior is something Microsoft should address.


  • EricPaul

    The best way to get what you want is to use ToolStripPanels instead of ToolStripContainer - you have to add these to the toolbox via Choose Items... command off the context menu in the toolbox. The design time experience with ToolStripPanel is pretty raw - it will autosize down to zero size pretty easily and docking them in the right order is critical  After you add these to the toolbox, dock them to the top, bottom, left, right in the correct z-order (use document outline). This should provide the operation and appearance you want for MDI and repositionable toolstrips. Hope this helps.

  • Usai

    "By Design" means that it is not a bug!

    However, it doesn't mean that it is not a big functionnal design issue: and it definitively is.


  • JohnsonZhang

    I agree!  I submitted a bug on this (specifically WRT the ToolStripContainer) and it got closed as "By Design".  Boo!

    http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx feedbackid=c7b2a5e7-15cf-4fbb-ab54-e6f2e9928a68


  • hghua

    WilliamW wrote:
    That way works much better than the ToolStripContainer control. I would suggest Microsoft spend a little more time enhancing the design time experience with this control and turning it on by default, especially when you try to do MDI type stuff, or you only want one menu bar w/o that annoying control area, this works like a charm.
    I agree, it's kinda sad that I even had to search for this to learn of that control.

  • Scott W.

    Thanks for this information...

    I suppose that it is quite the same for the SplitContainer... Could you confirm this

    Amadrias


  • victoriak68

    That way works much better than the ToolStripContainer control. I would suggest Microsoft spend a little more time enhancing the design time experience with this control and turning it on by default, especially when you try to do MDI type stuff, or you only want one menu bar w/o that annoying control area, this works like a charm.
  • Neil Walters

    this solution works, but now I have a problem with saving/loading the config by :

    private void MainFrm_FormClosing(object sender, FormClosingEventArgs e)

    {

    ToolStripManager.SaveSettings(this);

    }

    private void MainFrm_Load(object sender, EventArgs e)

    {

    ToolStripManager.LoadSettings(this);

    }

    On loading, the toolstrips and menustrip are not visible!!!

    Any solution

    Thanks


  • ToolStripContainers and MDI applications