In This Article

Standalone Toolbars

Standalone toolbars, represented by the ToolBar class, provide an alternative to the standard Windows Forms ToolBar control. They can be placed anywhere on a Form and used like a regular ToolBar control.

Screenshot

It is typically best to attach a BarManager to the toolbar.

Changing the Orientation

A toolbar's orientation can be changed by setting the Orientation property.

The CommandLinks collection stores all of the command links that are contained by the toolbar. To programmatically add a new command link to the bar control, simply add it to collection.

If the toolbar is attached to a BarManager and the BarManager is in customize mode in the designer, commands can be added to the standalone toolbar just like they are for dockable toolbars. The toolbar is only customizable via this functionality at design-time and cannot be customized by the end user at run-time.

The toolbar has several events that appear on the BarManager, such as CommandClick. These can be used for processing of command link clicks.

Important

If a BarManager is attached to the toolbar, only the events on the BarManager will be raised and not the equivalent events on the toolbar.