windowsforms-devexpress-dot-xtrabars-dot-baritem-aa1b2075.md
Gets or sets the BarItem‘s name.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Browsable(false)]
[DefaultValue("")]
public string Name { get; set; }
<Browsable(False)>
<DefaultValue("")>
Public Property Name As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
The BarItem‘s name.
|
The Name property can be used at runtime to evaluate an object by its name rather than by its type and programmatic name.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Name 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-ribbon-paint-bar-items/CS/WindowsApplication3/Form1.cs#L16
e.RibbonItemInfo.Appearance.ForeColor = Color.Red;
if(link.Item.Name == "barButtonItem1") {
if(e.State == DevExpress.XtraBars.ViewInfo.BarLinkState.Highlighted) {
winforms-assign-popupmenu-to-dropdownbutton/CS/DropDownButtonExample/Form1.cs#L31
item.ImageOptions.ImageIndex = imageIndex;
item.Name = name;
return item;
winforms-ribbon-paint-bar-items/VB/WindowsApplication3/Form1.vb#L19
If TypeOf link Is BarSubItemLink Then e.RibbonItemInfo.Appearance.ForeColor = Color.Red
If Equals(link.Item.Name, "barButtonItem1") Then
If e.State = ViewInfo.BarLinkState.Highlighted Then
winforms-assign-popupmenu-to-dropdownbutton/VB/DropDownButtonExample/Form1.vb#L32
item.ImageOptions.ImageIndex = imageIndex
item.Name = name
Return item
See Also