Provides a container for Windows toolbar objects.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Use and its associated classes in new Windows Forms applications to create toolbars that can have a Windows XP, Office, Internet Explorer, or custom appearance and behavior, all with or without themes, and with support for overflow and run-time item reordering. controls also offer a rich design-time experience that includes in-place activation and editing, custom layout, and sharing of horizontal or vertical space within a specified ToolStripContainer.
The class provides many members that manage painting, mouse and keyboard input, and drag-and-drop functionality. Use the ToolStripRenderer class with the ToolStripManager class to gain even more control and customizability over the painting and layout style of all controls on a Windows Form.
The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the control:
You can join controls within a specified ToolStripContainer and merge controls with each other. Use ToolStripPanel rather than ToolStripContainer for Multiple Document Interface (MDI) applications. Typically, a does not participate in the tab order unless it is absolutely positioned rather than being docked or in a ToolStripPanel.
Use the ToolStripControlHost class to host any other Windows Forms control in a .
By default, the is double buffered, taking advantage of the OptimizedDoubleBuffer setting.
Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Text Imports System.Windows.Forms Public Class Form1 Inherits Form Private toolStripContainer1 As ToolStripContainer Private toolStrip1 As ToolStrip Public Sub New() InitializeComponent() End Sub 'New <STAThread()> _ Shared Sub Main() Application.EnableVisualStyles() Application.Run(New Form1()) End Sub 'Main Private Sub InitializeComponent() toolStripContainer1 = New System.Windows.Forms.ToolStripContainer() toolStrip1 = New System.Windows.Forms.ToolStrip() ' Add items to the ToolStrip. toolStrip1.Items.Add("One") toolStrip1.Items.Add("Two") toolStrip1.Items.Add("Three") ' Add the ToolStrip to the top panel of the ToolStripContainer. toolStripContainer1.TopToolStripPanel.Controls.Add(toolStrip1) ' Add the ToolStripContainer to the form. Controls.Add(toolStripContainer1) End Sub 'InitializeComponent End Class 'Form1
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.