dxBarManagerToDxNavBar方法

procedure TForm1.dxBarManagerToDxNavBar;
var
  i, j: Integer;
  item: TdxBarSubItem;
  group: TdxNavBarGroup;
  bar: TdxNavBarItem;
begin
  dxNavBar1.Groups.Clear;
  for i := 0 to dxBarManager1Bar1.ItemLinks.Count - 1 do
  begin
    item := TdxBarSubItem(dxBarManager1Bar1.ItemLinks[i].Control.Item);   
    group := dxNavBar1.Groups.Add;
    group.Caption := item.Caption;
    for j := 0 to item.ItemLinks.Count - 1 do
    begin
      bar := dxNavBar1.Items.Add;
      bar.Caption := item.ItemLinks.Items[j].Caption;
      bar.OnClick := dxNavBarItemClick;
      bar.SmallImageIndex := 0;
      group.CreateLink(bar);
    end;
  end;
end;

posted @ 2011-04-09 23:24  delphi中间件  阅读(1290)  评论(0编辑  收藏  举报