示例#1
0
        /// <summary>
        /// 创建标题栏的子空间
        /// </summary>
        private void buildTitleSubControl()
        {
            // 标题栏图标
            PictureBox box = new PictureBox();

            box.Size                  = new Size(40, 40);
            box.BackgroundImage       = PublicFunction.getImageByFile("spider.png");
            box.BackgroundImageLayout = ImageLayout.Stretch;
            box.Location              = new Point(10, 5);
            titlePanel.Controls.Add(box);
            registerMouseEvent(box);

            // 标题栏,系统名字
            Label systemName = new Label();

            systemName.AutoSize  = false;
            systemName.Text      = "数据中心";
            systemName.ForeColor = Color.White;
            titlePanel.Controls.Add(systemName);
            systemName.Location  = new Point(55, 5);
            systemName.TextAlign = ContentAlignment.MiddleLeft;
            systemName.Width     = 200;
            systemName.Height    = 40;
            systemName.Font      = new System.Drawing.Font("仿宋", 14, FontStyle.Bold);
            systemName.BackColor = Color.Transparent;
            registerMouseEvent(systemName);


            // 注册用户显示控件
            UserInfoMenu userMenu = new UserInfoMenu();

            userMenu.BackColor = ColorTranslator.FromHtml("#62A8D1");
            titlePanel.Controls.Add(userMenu);
            userMenu.Location = new Point(this.Width - 152, 2);
            userMenu.Size     = new Size(150, 46);
            userMenu.buildUserInfo(null);
        }
示例#2
0
        public static void Operation()
        {
            var user = CreateUserHandler.Handle();

            UserInfoMenu.Display(user);
        }