Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();
            #region 初始化 OutLookBar
            outlookBar.BorderStyle = BorderStyle.FixedSingle;
            outlookBar.Initialize();
            IconPanel iconPanel1 = new IconPanel();
            iconPanel1.BorderStyle = BorderStyle.FixedSingle;
            IconPanel iconPanel2 = new IconPanel();
            IconPanel iconPanel3 = new IconPanel();

            outlookBar.AddBand("工具条A", iconPanel1);
            outlookBar.AddBand("工具条B", iconPanel2);
            outlookBar.AddBand("工具条C", iconPanel3);

            //0
            iconPanel1.AddIcon("信息查询", Image.FromFile(@"Image\1.ico"), new EventHandler(PanelEventA));
            //1
            iconPanel1.AddIcon("购物车管理", Image.FromFile(@"Image\2.ico"), new EventHandler(PanelEventA));
            //2
            iconPanel2.AddIcon("电子邮件", Image.FromFile(@"Image\3.ico"), new EventHandler(PanelEventB));
            //3
            iconPanel2.AddIcon("密码管理", Image.FromFile(@"Image\4.ico"), new EventHandler(PanelEventB));
            //4
            iconPanel3.AddIcon("时间设置", Image.FromFile(@"Image\4.ico"), new EventHandler(PanelEventC));
            outlookBar.SelectBand(0);
            #endregion
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化工具栏中的内容
        /// </summary>
        public void initToolBar()
        {
            List <string> groups = layoutBLL.getAllGroupName();

            for (int i = 0; i < groups.Count; i++)
            {
                IconPanel iconPanel1 = new IconPanel();

                MainToolBar.AddBand(groups[i].ToString(), iconPanel1);
                List <Outlook_Table_Jb_User> items = layoutBLL.getItemNameByGroupName(groups[i].ToString());
                table.Add(iconPanel1, items);
                for (int j = 0; j < items.Count; j++)
                {
                    Outlook_Table_Jb_User outlook = items[j];
                    iconPanel1.AddIcon(outlook.Itemname, imlMain.Images[outlook.Picname], new MouseEventHandler(PanelEvent));
                }
            }
            //if (groups.Count < 3)
            //{
            MainToolBar.SelectBand(0);
            //}
            //else
            //{
            //    MainToolBar.SelectBand(3);
            //    openWatchMain();
            //}
        }