Back to Devexpress

BarItem.Tag Property

windowsforms-devexpress-dot-xtrabars-dot-baritem-3f05d0f8.md

latest4.1 KB
Original Source

BarItem.Tag Property

Gets or sets an object that contains data on the current item.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(null)]
public object Tag { get; set; }
vb
<DefaultValue(Nothing)>
Public Property Tag As Object

Property Value

TypeDefaultDescription
Objectnull

An Object that contains data on the current item.

|

Remarks

Any user value can be assigned to this property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Tag 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-richeditcontrol-common-api/CS/RichEditAPISample/CodeExamples/RichEditControlActions.cs#L19

csharp
buttonCustomAction.ItemClick += buttonCustomAction_ItemClick_ShowSearchFormMethod;
buttonCustomAction.Tag = richEditControl;
richEditControl.Text = "Click the 'Custom Action' button located in the ribbon to invoke the 'Find and Replace' dialog switched to the 'Find' tab and with the 'test' word used for search";

winforms-spreadsheet-spell-check-cell-text/CS/SpreadsheetSpellchecking/Form1.cs#L52

csharp
item.Enabled = command.Enabled;
item.Tag = command;
item.ItemClick += OnPopupMenu_ItemClick;

winforms-generate-skin-palettes-with-ai/CS/DevExpress.AI.WinForms.AIGeneratePalette.Demo/AccordionShellForm.cs#L99

csharp
void gptCheckItem_CheckedChanged(object sender, ItemClickEventArgs e) {
    IChatClient chatClient = ChatClientFactory.Create((string)e.Item.Tag);
    var defaultContainer = AIExtensionsContainerDesktop.Default;

winforms-richeditcontrol-common-api/VB/RichEditAPISample/CodeExamples/RichEditControlActions.vb#L21

vb
AddHandler buttonCustomAction.ItemClick, AddressOf buttonCustomAction_ItemClick_ShowSearchFormMethod
buttonCustomAction.Tag = richEditControl
richEditControl.Text = "Click the 'Custom Action' button located on the RibbonControl to invoke the 'Find and Replace' dialog switched to the 'Search' tab and with the 'test' word used for search"

winforms-spreadsheet-spell-check-cell-text/VB/SpreadsheetSpellchecking/Form1.vb#L57

vb
item.Enabled = command.Enabled
item.Tag = command
AddHandler item.ItemClick, AddressOf OnPopupMenu_ItemClick

See Also

BarItem Class

BarItem Members

DevExpress.XtraBars Namespace