ToolStripContainer Class
Collapse the table of content
Expand the table of content

ToolStripContainer Class

Provides panels on each side of the form and a central panel that can hold one or more controls.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

public class ToolStripContainer : ContainerControl
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ 
public class ToolStripContainer extends ContainerControl
public class ToolStripContainer extends ContainerControl
Not applicable.

ToolStripContainer is similar to SplitContainer. It uses four docked side panels (instances of ToolStripPanel) and one central panel (an instance of ToolStripContentPanel) to create a typical arrangement. You cannot remove the side panels, but you can hide them by setting their respective TopToolStripPanelVisible, BottomToolStripPanelVisible, LeftToolStripPanelVisible, and RightToolStripPanelVisible properties to false. By default, each of these properties is true at design time. Also at design time, the ToolStripContainer appears with its top panel already expanded. You can neither remove nor hide the ToolStripContentPanel. You can arrange one or more ToolStrip, MenuStrip, or StatusStrip controls in the side panels, and you can use the central panel for other controls. The ToolStripContentPanel also provides a way to get renderer support into the body of your form for a consistent appearance.

ToolStripContainer does not support Multiple Document Interface (MDI) applications. Use ToolStripPanel for MDI applications.

The following code example demonstrates adding a ToolStripContainer and a ToolStrip to a Windows Forms, adding items to the ToolStrip, and adding the ToolStrip to the TopToolStripPanel of the ToolStripContainer.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

public class Form1 : Form
    private ToolStripContainer toolStripContainer1;
    private ToolStrip toolStrip1;

    public Form1()
    static void Main()
        Application.Run(new Form1());

    private void InitializeComponent()
        toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
        toolStrip1 = new System.Windows.Forms.ToolStrip();
        // Add items to the ToolStrip.
        // Add the ToolStrip to the top panel of the ToolStripContainer.
        // Add the ToolStripContainer to the form.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2015 Microsoft