Toolbars

The Windows Forms ToolBar control is used on forms as a control bar that displays a row of bitmapped buttons and drop-down menus that activate commands. Thus, clicking a toolbar button can be equivalent to choosing a menu command. Indeed, a toolbar button often duplicates the functionality of a menu item. "Ask the Expert" following this section discusses why toolbar buttons are used to duplicate the functionality of a menu item.

Adding the Toolbar and Buttons

You create a toolbar by dragging a ToolBar control from the Toolbox onto the form. However, unlike the MainMenu and ContextMenu components, the ToolBar control does not appear in the component tray. Instead, it appears as a large gray area under the menu.

The next step is to add buttons to the toolbar. You can add buttons to the toolbar at both design time and runtime.

Was this article helpful?

0 0

Post a comment