Back to Devexpress

BarManager.Categories Property

windowsforms-devexpress-dot-xtrabars-dot-barmanager-969c5581.md

latest3.2 KB
Original Source

BarManager.Categories Property

Gets a collection of categories used to logically organize bar items.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Browsable(false)]
public BarManagerCategoryCollection Categories { get; }
vb
<Browsable(False)>
Public ReadOnly Property Categories As BarManagerCategoryCollection

Property Value

TypeDescription
BarManagerCategoryCollection

A BarManagerCategoryCollection object that represents the collection of categories.

|

Remarks

Use this property to access a collection of categories created in the BarManager. Categories are used to logically organize items and this provides a convenient way to access items from the Customization Form. This property allows you to add, remove and get individual categories. Each category is represented by a BarManagerCategory object.

You can assign an item to a specific category by specifying the item’s BarItem.Category property.

For more information, see the How To: Organize Bar Items into Categories document.

Example

The following sample code creates a new category and adds it to the BarManager’s BarManager.Categories collection. Then, the category created is assigned to the first item in the BarManager’s BarManager.Items collection.

csharp
if (barManager1.Categories.IndexOf("NewCategory") == -1) {
   barManager1.Items[0].Category = barManager1.Categories.Add("NewCategory");
}
vb
If BarManager1.Categories.IndexOf("NewCategory") = -1 Then
   BarManager1.Items(0).Category = BarManager1.Categories.Add("NewCategory")
End If

See Also

BarManagerCategory

ShowCustomizationForm()

How To: Organize Bar Items into Categories

BarManager Class

BarManager Members

DevExpress.XtraBars Namespace