ToolBar Control (Windows Forms)
The Windows Forms ToolBar control is used on forms as a control bar that displays a row of drop-down menus and bitmapped buttons that activate commands. Thus, clicking a toolbar button is equivalent to choosing a menu command. The buttons can be configured to appear and behave as push buttons, drop-down menus, or separators. Typically, a toolbar contains buttons and menus that correspond to items in an application's menu structure, providing quick access to an application's most frequently used functions and commands.
Note The ToolBar control's DropDownMenu property takes an instance of the ContextMenu class as a reference. Pay particular attention to the reference you pass when implementing this sort of button on toolbars in your application, as the property will accept any object that inherits from the Menu class.
In This Section
- Introduction to the Windows Forms ToolBar Control
- Introduces the general concepts of the ToolBar control, which allows you to design custom toolbars that your users can work with.
- Adding Buttons to a Toolbar
- Describes how to add buttons to a ToolBar control.
- Defining an Icon for a Toolbar Button
- Describes how to display icons within a ToolBar control's buttons.
- Triggering Menu Events for Toolbar Buttons
- Gives directions on writing code to interpret which button the user clicks in a ToolBar control.