Back to Devexpress

How to: Create a category and add a bar item to it

windowsforms-5480-controls-and-libraries-ribbon-bars-and-menu-examples-bars-how-to-create-a-category-and-add-a-bar-item-to-it.md

latest776 B
Original Source

How to: Create a category and add a bar item to it

  • Nov 13, 2018

The following code shows how to create a new category and a bar item, and assign the item to the category:

csharp
using DevExpress.XtraBars;
//...
BarManagerCategory category = barManager1.Categories.Add("Development");
BarItem item = new BarButtonItem(barManager1, "Tool1");
item.Category = category;
//customize the item and add it to a bar/menu
//...
vb
Imports DevExpress.XtraBars
'...
Dim category As BarManagerCategory = barManager1.Categories.Add("Development")
Dim item As BarItem = new BarButtonItem(barManager1, "Tool1")
item.Category = category
'customize the item and add it to a bar/menu
'...