zoukankan      html  css  js  c++  java
  • dev中动态初始化菜单栏

     Bar bar = new Bar();

                barManager2.Bars.Add(bar);

                for (int i = 0; i < menus.Count; i++)
                {
                    BarSubItem subitem=new BarSubItem();
                    subitem.Caption=menus[i].Name;
                    subitem.Name=menus[i].Identifier;
                    subitem.Id = barManager2.Items.Count + 1; ;       
                    subitem.Visibility = BarItemVisibility.Always;

                    barManager2.Items.Add(subitem);
                    bar.ItemLinks.Add(subitem);
                    MultiMenus child=menus[i].SubMenus;
                    for (int j = 0; j < child.Count; j++)
                    {
                        BarButtonItem button = new BarButtonItem();
                        button.Caption = child[j].Name;
                        button.Tag = child[j].Identifier;
                        button.Id = barManager2.Items.Count + 1;
                        button.Visibility = BarItemVisibility.Always;
                        subitem.ItemLinks.Add(button);
                        (button as BarItem).Manager = barManager2;
                    }
                }
                bar.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
                barManager2.MainMenu = bar;

  • 相关阅读:
    没有一个计时器控制在VB6计时器功能
    检测系统范围内的鼠标事件
    c# Com
    tcpdump
    dd
    dumpe/dumpe2fs/e2fsck
    fdisk
    mkswap/swapon/swapoff/free
    mkfs/mk2fs/fsck/e2fsck/tune2fs/blkid
    parted
  • 原文地址:https://www.cnblogs.com/weihongli/p/3115788.html
Copyright © 2011-2022 走看看