Skip to main content
A newer version of this page is available. .
Bar

BarItem Class

Provides the functionality of bar elements.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v18.1.dll

Declaration

[SmartTagSupport(typeof(BarItemDesignTimeBoundsProvider), SmartTagSupportAttribute.SmartTagCreationMode.Auto)]
[SmartTagFilter(typeof(BarItemSmartTagFilter))]
public class BarItem :
    Component,
    IXtraSerializable,
    ICustomTypeDescriptor,
    IAppearanceOwner,
    IBindableComponent,
    IComponent,
    IDisposable,
    IDXImageUriClient,
    ISupportAdornerElementBarItem,
    IUpdateAdornerUI,
    IDXMenuItemOwner

Remarks

BarItem describes the functionality for any object located within a bar. Items are non-visual elements that contain methods and properties of the object within a bar and process specific object events. Item defines an object’s response to mouse clicks or key press events. Properties displayed within the Properties section of the Customization window are item properties.

Items in Customization

A BarItem can be placed onto any existing bar or menu and based upon the item’s location, its behavior changes: in a bar, the item is a regular bar button, which can be clicked by a mouse or activated by a shortcut key combination. In a menu, the bar item is a specific menu command.

Note

If you create Bar Items in code, note that these objects may not function properly without being associated with a BarManager or RibbonControl. To create a Bar Item, use a Bar Item constructor that has the BarManager parameter. When creating a Bar Item in code for use within a RibbonControl, use a Bar Item constructor that has the BarManager parameter, and pass the RibbonControl.Manager object as this parameter.

The following code snippets (auto-collected from DevExpress Examples) contain references to the BarItem class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also