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

BarItem.Caption Property

A string containing the item’s caption.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v19.2.dll

Declaration

[DXCategory("Appearance")]
public virtual string Caption { get; set; }

Property Value

Type Description
String

A string that specifies the item’s caption.

Remarks

Bar items can be displayed within Bars, RibbonControls and popup menus.

A caption represents an item within a bar if the BarItem.PaintStyle property value of that item is set to the BarItemPaintStyle.Caption, BarItemPaintStyle.CaptionInMenu or BarItemPaintStyle.CaptionGlyph value or that item has no associated icon. The item’s caption can be used to assign a hot key for the current item. This hotkey is one of the caption symbols pressed together with the Alt key. The caption letter used in a hot key combination is defined by entering an ampersand before the required symbol. The appropriate symbol is underlined in the caption.

A RichEditControl allows you to create a Bars or Ribbon UI, where bars and Ribbon controls contain a set of predefined RichEditControl-aware commands (bar items). These items have predefined captions, which you can change according to your needs. Setting the Caption properties for these items to empty strings will result in reverting the captions to their initial values.

You have the ability to format the Caption using HTML tags. To enable this feature for all bar items within a BarManager or RibbonControl, use the BarManager.AllowHtmlText and RibbonControl.AllowHtmlText property, respectively. To enable this feature for individual bar items, use the BarItem.AllowHtmlText property.

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

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