ToolStripContainer in Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This lesson describes the ToolStripContainer control


This control contains a ToolStripPanel along each of its edges where a ToolStrip control can dock.

Its center is filled with another ToolStripPanel that can contain other controls that are not part of the tool strips.

You can drag the ToolStrips around and position them inside of any of the ToolStripPanel controls as much as you can move the toolbars in the Visual Basic development environment.

Then you can drag the ToolStrips into multiple rows or columns within the panels.


The ToolStripContainer control's LeftToolStripPanel, RightToolStripPanel, TopToolStripPanel, BottomToolStripPanel, and ContentPanel properties contain references to the ToolStripPanel controls that the control contains.

Its LeftToolStripPanelVisible, RightToolStripPanelVisible, TopToolStripPanelVisible, and BottomToolStripPanelVisible properties let you show or hide specific panels.

Private Sub ToolStripContainerControl_Load(sender As Object, e As EventArgs) _
 Handles MyBase.Load
    ' hide the left panel
    ToolStripContainer1.LeftToolStripPanel.Visible = False

    ' hide the right panel (using the RightToolStripPanelVisible property)
    ToolStripContainer1.RightToolStripPanelVisible = False
End Sub

Previous Lesson | Next Lesson

Share This

Home | About | Contact | Privacy Policy

Copyright 2017 - All Rights Reserved.