传统菜单
//创建一个dxSubItem,相当于创建一个主菜单项
dxBarSubItem := TdxBarSubItem.Create(Self);
dxBarSubItem.Caption := sCategory;
dxBarSubItem.Category := 0;
dxBarSubItem.Visible := ivAlways;//ivNever;//
dxBarSubItem.Name := sName;
//放置在dxBar上
dxBarItemLink := dxBarSubItem.BarManager.Bars[0].ItemLinks.Add;
dxBarItemLink.Item := dxBarSubItem;
//创建一个dxBarButton,相当于创建一个菜单项
dxBarButton := TdxBarButton.Create(Self);//内存资源由Self负责管理
dxBarButton.Caption := sMenu;
dxBarButton.Action := TAction(ActionManger1.Actions[iAction]);
dxBarButton.Category := 0;
dxBarButton.Tag := TAction(ActionManger1.Actions[iAction]).Tag;
//dxBarButton.Name := TAction(ActionManger1.Actions[iAction]).Name;//Format(‘dxBarButton_%-2d‘,[ii]);
dxBarItemLink := dxBarSubItem.ItemLinks.Add;
dxBarItemLink.Item := dxBarButton;
原文:http://www.cnblogs.com/hnxxcxg/p/5329501.html