internal void buildControl() { // 角色列表 roleListTree = new BaseTreeView(); roleListTree.BackColor = Color.Gray; this.Controls.Add(roleListTree); roleListTree.BorderStyle = BorderStyle.None; roleListTree.ItemHeight = 60; roleListTree.Font = new Font("宋体", 10); roleListTree.NodeMouseClick += roleListTree_NodeMouseClick; roleListTree.Invalidate(); if (basePanel == null) { // 基础配置 basePanel = new Panel(); this.Controls.Add(basePanel); addSubControl(basePanel, "用戶列表"); } addPic = new PictureBox(); addPic.SizeMode = PictureBoxSizeMode.StretchImage; this.Controls.Add(addPic); }
internal void buildControl() { // 角色列表 roleListTree = new BaseTreeView(); roleListTree.BackColor = Color.Gray; this.Controls.Add(roleListTree); roleListTree.BorderStyle = BorderStyle.None; roleListTree.ItemHeight = 60; roleListTree.Font = new Font("宋体", 10); roleListTree.NodeMouseClick += roleListTree_NodeMouseClick; roleListTree.Invalidate(); // 添加 addRole = new ShapeButton(); this.Controls.Add(addRole); addRole.Text = "添加"; addRole.ForeColor = Color.White; addRole.Font = new Font("宋體", 13, FontStyle.Bold); removeRole = new ShapeButton(); this.Controls.Add(removeRole); removeRole.Text = "刪除"; removeRole.ForeColor = Color.White; removeRole.Font = new Font("宋體", 13, FontStyle.Bold); /////////功能列表 if (basePanel == null) { // 基础配置 basePanel = new Panel(); this.Controls.Add(basePanel); addSubControl(basePanel, "功能列表1"); } if (savePanel == null) { // 存储设置 savePanel = new Panel(); this.Controls.Add(savePanel); addSubControl(savePanel, "功能列表2"); } if (dbPanel == null) { // 数据配置 dbPanel = new Panel(); this.Controls.Add(dbPanel); addSubControl(dbPanel, "功能列表3"); } }
/// <summary> /// 动态创建控件 /// </summary> private void buildControl() { titlePanel = new Panel(); titlePanel.BackColor = ColorTranslator.FromHtml("#438EB9"); this.Controls.Add(titlePanel); // 注册鼠标事件到窗体 registerMouseEvent(titlePanel); corpName = new Label(); corpName.AutoSize = false; corpName.Text = "上海数码科技"; corpName.TextAlign = ContentAlignment.MiddleCenter; corpName.ForeColor = Color.Black; corpName.BackColor = Color.White; this.Controls.Add(corpName); systemTree = new BaseTreeView(); this.Controls.Add(systemTree); systemTree.BorderStyle = BorderStyle.None; systemTree.ItemHeight = 60; systemTree.Font = new Font("宋体", 10); systemTree.ImageList = initImages(); systemTree.NodeMouseClick += systemTree_NodeMouseClick; systemTree.Invalidate(); bar = new NativeBar(); this.Controls.Add(bar); // setCtrl = new SystemSetting(); this.Controls.Add(setCtrl); setCtrl.Visible = false; setCtrl.buildControl(); logPanel = new LoggerPannel(); this.Controls.Add(logPanel); logPanel.Visible = false; logPanel.buildControl(); roleCtrl = new RoleControl(); grantCtrl = new GrantControl(); this.Controls.Add(roleCtrl); this.Controls.Add(grantCtrl); roleCtrl.Visible = false; grantCtrl.Visible = false; roleCtrl.buildControl(); grantCtrl.buildControl(); orderControl = new OrderControl(); this.Controls.Add(orderControl); orderControl.buildControl(); orderControl.Visible = false; terminalCtrl = new TerminalControl(); this.Controls.Add(terminalCtrl); terminalCtrl.buildControl(); terminalCtrl.Visible = false; }