System.Windows.Forms.ToolStrip Class

Provides a container for Windows toolbar objects.

See Also: ToolStrip Members

Syntax

[System.ComponentModel.Design.Serialization.DesignerSerializer("System.Windows.Forms.Design.ToolStripCodeDomSerializer, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.Serialization.CodeDomSerializer, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Designer("System.Windows.Forms.Design.ToolStripDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
[System.ComponentModel.DefaultProperty("Items")]
[System.ComponentModel.DefaultEvent("ItemClicked")]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ToolStrip : ScrollableControl, IToolStripData

Remarks

System.Windows.Forms.ToolStrip is the base class for System.Windows.Forms.MenuStrip, System.Windows.Forms.StatusStrip, and System.Windows.Forms.ContextMenuStrip.

Use System.Windows.Forms.ToolStrip 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. System.Windows.Forms.ToolStrip 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 System.Windows.Forms.ToolStripContainer.

The System.Windows.Forms.ToolStrip class provides many members that manage painting, mouse and keyboard input, and drag-and-drop functionality. Use the System.Windows.Forms.ToolStripRenderer class with the System.Windows.Forms.ToolStripManager class to gain even more control and customizability over the painting and layout style of all System.Windows.Forms.ToolStrip controls on a Windows Form.

The following items are specifically designed to work seamlessly with both System.Windows.Forms.ToolStripSystemRenderer and System.Windows.Forms.ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the System.Windows.Forms.ToolStrip control:

You can join System.Windows.Forms.ToolStrip controls within a specified System.Windows.Forms.ToolStripContainer and merge System.Windows.Forms.ToolStrip controls with each other. Use System.Windows.Forms.ToolStripPanel rather than System.Windows.Forms.ToolStripContainer for Multiple Document Interface (MDI) applications. Typically, a System.Windows.Forms.ToolStrip does not participate in the tab order unless it is absolutely positioned rather than being docked or in a System.Windows.Forms.ToolStripPanel.

Use the System.Windows.Forms.ToolStripControlHost class to host any other Windows Forms control in a System.Windows.Forms.ToolStrip.

By default, the System.Windows.Forms.ToolStrip is double buffered, taking advantage of the ControlStyles.OptimizedDoubleBuffer setting.

Although System.Windows.Forms.ToolStrip replaces and adds functionality to the System.Windows.Forms.ToolBar control of previous versions, System.Windows.Forms.ToolBar is retained for both backward compatibility and future use if you choose.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0