windowsforms-devexpress-dot-xtrabars-dot-baritemlinkcollection-dot-add-x28-devexpress-dot-xtrabars-dot-baritem-x29.md
Creates a link to the specified bar item and adds it to the end of the collection.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public virtual BarItemLink Add(
BarItem item
)
Public Overridable Function Add(
item As BarItem
) As BarItemLink
| Name | Type | Description |
|---|---|---|
| item | BarItem |
A BarItem descendant, for which a link is added to the collection.
|
| Type | Description |
|---|---|
| BarItemLink |
A BarItemLink object representing the link added.
|
A bar item must belong to the BarManager’s BarManager.Items collection so that a link to it can be created and added to the collection. Otherwise, an exception will be raised.
To add several links to different bar items at once, see the BarItemLinkCollection.AddRange method.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(BarItem) method.
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.
barItem = CreateBarItem("Scale Break", barImage);
group.ItemLinks.Add(barItem);
barItem.ItemClick += ChangeCustomPropertyValue;
group.ItemLinks.Add(enableBarItem);
group.ItemLinks.Add(showTitlesBarItem);
winforms-spreadsheet-spell-check-cell-text/CS/SpreadsheetSpellchecking/Form1.cs#L54
item.ItemClick += OnPopupMenu_ItemClick;
itemLinks.Add(item);
}
urlBarItem.EditWidth = 150;
group.ItemLinks.Add(urlBarItem);
}
dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineModule.cs#L116
barItem = CreateBarItem();
group.ItemLinks.Add(barItem);
}
barItem = CreateBarItem("Scale Break", barImage)
group.ItemLinks.Add(barItem)
AddHandler barItem.ItemClick, AddressOf ChangeCustomPropertyValue
group.ItemLinks.Add(enableBarItem)
group.ItemLinks.Add(showTitlesBarItem)
winforms-spreadsheet-spell-check-cell-text/VB/SpreadsheetSpellchecking/Form1.vb#L59
AddHandler item.ItemClick, AddressOf OnPopupMenu_ItemClick
itemLinks.Add(item)
Next
urlBarItem.EditWidth = 150
group.ItemLinks.Add(urlBarItem)
End Sub
See Also