Back to Devexpress

BarButtonItem.Caption Property

windowsforms-devexpress-dot-xtrabars-dot-barbuttonitem-e76b4258.md

latest5.6 KB
Original Source

BarButtonItem.Caption Property

Gets or sets the BarButtonItem‘s caption.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public override string Caption { get; set; }
vb
Public Overrides Property Caption As String

Property Value

TypeDescription
String

A String value that is the BarButtonItem‘s caption.

|

Remarks

You can format BarButtonItem’s Caption and BarButtonItem.Description via HTML tags if the BarItem.AllowHtmlText property equals true.

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.

winforms-dashboard-custom-properties/CS/WinForms-Dashboard-Custom-Properties/Modules/DashboardDescriptionModule.cs#L34

csharp
BarButtonItem barItem = new BarButtonItem();
barItem.Caption = caption;
barItem.ImageOptions.SvgImage = barImage;

reporting-winforms-export-doc-odt/CS/WindowsFormsApplication1/Form1.cs#L40

csharp
barItem.ItemClick += new ItemClickEventHandler(barItem_ItemClick);
barItem.Caption = "DOC File";
control.AddItem(barItem);

connect-winforms-grid-to-dotnetcore-service-enable-pbac/CS/WinForms.Client/MainForm.cs#L78

csharp
EvaluateRoles();
logOutItem.Caption = $"Log out {DataServiceClient.Name}{(userIsWriter ? " (Writer)" : "")}";
if (overlayHandle is not null)

winforms-pdf-viewer-manage-popup-menu-items/CS/RemoveItemsFromPopupMenu/Form1.cs#L22

csharp
BarButtonItem browseBarButton = new BarButtonItem();
browseBarButton.Caption = "Custom Item";

dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineModule.cs#L100

csharp
BarButtonItem barItem = new BarButtonItem();
barItem.Caption = barButtonCaption;
barItem.ImageOptions.SvgImage = global::ConstantLineExtension.Win.Properties.Resources.ConstantLineSettings;

winforms-dashboard-custom-properties/VB/WinForms-Dashboard-Custom-Properties/Modules/DashboardDescriptionModule.vb#L34

vb
Dim barItem As New BarButtonItem()
barItem.Caption = caption
barItem.ImageOptions.SvgImage = barImage

reporting-winforms-export-doc-odt/VB/WindowsFormsApplication1/Form1.vb#L40

vb
AddHandler barItem.ItemClick, AddressOf barItem_ItemClick
barItem.Caption = "DOC File"
control.AddItem(barItem)

winforms-pdf-viewer-manage-popup-menu-items/VB/RemoveItemsFromPopupMenu/Form1.vb#L20

vb
Dim browseBarButton As BarButtonItem = New BarButtonItem()
browseBarButton.Caption = "Custom Item"
' Insert the bar buttom item into the PDF Viewer popup menu and start a new group.

winforms-assign-popupmenu-to-dropdownbutton/VB/DropDownButtonExample/Form1.vb#L29

vb
Dim item As BarButtonItem = New BarButtonItem()
item.Caption = caption
item.Id = barManager1.GetNewItemId()

See Also

Description

BarButtonItem Class

BarButtonItem Members

DevExpress.XtraBars Namespace