ToolStrip Control Overview (Windows Forms)
The Windows Forms ToolStrip control and its associated classes provide a common framework for combining user interface elements into toolbars, status bars, and menus. ToolStrip controls offer a rich design-time experience that includes in-place activation and editing, custom layout, and rafting, which is the ability of toolbars to share horizontal or vertical space.
Use the ToolStrip control to:
Present a common user interface across containers.
Create easily customized, commonly employed toolbars that support advanced user interface and layout features, such as docking, rafting, buttons with text and images, drop-down buttons and controls, overflow buttons, and run-time reordering of ToolStrip items.
Support overflow and run-time item reordering. The overflow feature moves items to a drop-down menu when there is not enough room to display them in a ToolStrip.
Support the typical appearance and behavior of the operating system through a common rendering model.
Handle events consistently for all containers and contained items, in the same way you handle events for other controls.
Create drop-down controls and user interface type editors with advanced layouts in a ToolStripDropDown.
You can extend the functionality and modify the appearance and behavior by using the ToolStripRenderer, ToolStripProfessionalRenderer, and ToolStripManager along with the ToolStripRenderMode and ToolStripManagerRenderMode enumerations.
The ToolStrip control is highly configurable and extensible, and it provides many properties, methods, and events to customize appearance and behavior. Below are some noteworthy members:
Gets or sets which edge of the parent container a ToolStrip is docked to.
Gets or sets a value indicating whether drag-and-drop and item reordering are handled privately by the ToolStrip class.
Gets or sets a value indicating how the ToolStrip lays out its items.
Gets or sets the painting styles to be applied to the ToolStrip.
Raised when the Renderer property changes.
The ToolStrip control's flexibility is achieved through the use of a number of companion classes. Below are some of the most noteworthy:
Replaces and adds functionality to the MainMenu class.
Replaces and adds functionality to the StatusBar class.
Replaces and adds functionality to the ContextMenu class.
Provides a container with a panel on each side of the form in which controls can be arranged in various ways.
Handles the painting functionality for ToolStrip objects.
Provides Microsoft Office-style appearance.
Specifies the painting style (custom, Windows XP, or Microsoft Office Professional) applied to multiple ToolStrip objects contained in a form.
Specifies the painting style (custom, Windows XP, or Microsoft Office Professional) applied to one ToolStrip object contained in a form.