下列代码展示了如何新建一个类别和一个 bar item,并把 bar item 添加到该类别中:

C#CopyCode image复制代码
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
//...
Visual BasicCopyCode image复制代码
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
'...