Ejemplo n.º 1
0
        //初始化UI
        private void InitUI()
        {
            //
            if (this.manager != null)
            {
                this.textEdit1.Text = this.manager.Name;
            }
            List <HomePageNodeModel> modelList = XMLDataManage.GetNodesXML();

            AddTreeNode(null, modelList);
            this.treeView1.ShowLines = false;           //不显示线
            this.treeView1.ExpandAll();                 //展开所有节点
            this.treeView1.ShowPlusMinus = false;       //不显示节点图标
            this.treeView1.ItemHeight    = 19;
        }
Ejemplo n.º 2
0
        private void InitUI()
        {
            MainViewManage.MainView = this.mainPanel;
            //添加按钮列
            List <HomePageNodeModel> modelList = XMLDataManage.GetNodesXML();

            for (int i = modelList.Count - 1; i >= 0; i--)
            {
                HomePageNodeModel nodeModel = modelList[i];
                SimpleButton      button    = new SimpleButton();
                button.Text                 = nodeModel.nodeName;
                button.ButtonStyle          = DevExpress.XtraEditors.Controls.BorderStyles.UltraFlat;
                button.Appearance.BackColor = NOR_BACK_COLOR;
                button.Size                 = new Size(50, 40);
                button.ForeColor            = Color.White;
                button.Font                 = new Font("宋体", 12, GraphicsUnit.Pixel);
                button.Margin               = new Padding(0);
                button.Padding              = new Padding(0);
                button.Dock                 = DockStyle.Top;
                button.AllowFocus           = false;
                button.ShowFocusRectangle   = DevExpress.Utils.DefaultBoolean.False;
                //button.ImageToTextAlignment = ImageAlignToText.LeftCenter;
                button.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
                button.Click += Button_Click;
                button.Tag    = nodeModel;
                button.Paint += Button_Paint;
                if (nodeModel.imgName == null || nodeModel.imgName == "")
                {
                    button.Image = Imgs.icon_huiyuan;
                }
                else
                {
                    button.Image = Imgs.GetBitImg(nodeModel.imgName);
                }
                this.functionPanel.Controls.Add(button);
                Image img = Imgs.GetBitImg(nodeModel.imgName);
            }
            ////添加首页视图
            AddHomePageView();
            //添加系统消息监听
            AddMsgDelegate();
        }