示例#1
0
        public XUICustomGroupbox customizeGb(long soluong, String tenmmon, int index, String loaiNao = null)
        {
            XUICustomGroupbox xuiCustomGroupbox1 = new XUICustomGroupbox();
            Label             label = new Label();

            xuiCustomGroupbox1.BorderColor = System.Drawing.Color.SteelBlue;
            xuiCustomGroupbox1.BorderWidth = 1;
            xuiCustomGroupbox1.Font        = new System.Drawing.Font("Consolas", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            xuiCustomGroupbox1.ShowText    = true;
            xuiCustomGroupbox1.Size        = new System.Drawing.Size(322, 55);
            xuiCustomGroupbox1.TabStop     = false;
            xuiCustomGroupbox1.TextColor   = System.Drawing.Color.DodgerBlue;

            switch (index)
            {
            case 0:
            {
                xuiCustomGroupbox1.BackColor = System.Drawing.Color.MistyRose;
                break;
            }

            case 1:
            {
                xuiCustomGroupbox1.BackColor = System.Drawing.Color.LightGreen;
                break;
            }

            case 2:
            {
                xuiCustomGroupbox1.BackColor = System.Drawing.Color.AliceBlue;
                break;
            }
            }

            label.Font      = new System.Drawing.Font("Consolas", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            label.ForeColor = System.Drawing.Color.DimGray;
            label.Padding   = new System.Windows.Forms.Padding(0, 0, 10, 0);
            label.Size      = new System.Drawing.Size(251, 24);
            label.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            label.Location  = new System.Drawing.Point(65, 22);


            label.Text = tenmmon;
            xuiCustomGroupbox1.Text = soluong.ToString();
            if (!String.IsNullOrWhiteSpace(loaiNao))
            {
                if (loaiNao.Contains("thucuong"))
                {
                    xuiCustomGroupbox1.BorderColor = System.Drawing.Color.Maroon;
                    xuiCustomGroupbox1.TextColor   = System.Drawing.Color.Maroon;
                }
                else if (loaiNao.Contains("nhanvien"))
                {
                    xuiCustomGroupbox1.Text = soluong.ToString("C0");
                }
            }
            xuiCustomGroupbox1.Controls.Add(label);
            return(xuiCustomGroupbox1);
        }
示例#2
0
        private XUICustomGroupbox createCustomBtn(Ban ban)
        {
            XUICustomGroupbox grbBan    = new XUICustomGroupbox();
            IconButton        ibutton   = new IconButton();
            Label             lbltenban = new Label();

            lbltenban.AutoSize = true;
            lbltenban.Font     = new System.Drawing.Font("Adobe Heiti Std R", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
            lbltenban.Size     = new System.Drawing.Size(48, 16);
            lbltenban.TabIndex = 2;
            lbltenban.Text     = ban.Tenban + " - " + ban.Makhuvuc;
            lbltenban.Location = new System.Drawing.Point(12, 99);

            ibutton.BackgroundImageLayout     = ImageLayout.Zoom;
            ibutton.FlatAppearance.BorderSize = 0;
            ibutton.FlatStyle = FlatStyle.Flat;
            ibutton.Flip      = FlipOrientation.Normal;
            ibutton.IconChar  = IconChar.None;
            ibutton.Rotation  = 0D;
            ibutton.Size      = new System.Drawing.Size(80, 80);
            ibutton.UseVisualStyleBackColor = true;
            ibutton.Dock   = System.Windows.Forms.DockStyle.Top;
            ibutton.Tag    = ban;
            ibutton.Click += eventClickBan;
            // group box
            grbBan.BorderWidth = 1;
            grbBan.Font        = new System.Drawing.Font("Cooper Black", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            grbBan.ShowText    = true;
            grbBan.Size        = new System.Drawing.Size(115, 120);
            grbBan.TabIndex    = 0;
            grbBan.TabStop     = false;
            grbBan.Margin      = new System.Windows.Forms.Padding(10, 3, 3, 3);

            if (ban.Trangthai.Contains("empty"))
            {
                grbBan.Text             = "Free";
                grbBan.TextColor        = System.Drawing.Color.MidnightBlue;
                grbBan.BorderColor      = System.Drawing.Color.MidnightBlue;
                ibutton.BackgroundImage = global::Viva_vegan.Properties.Resources.ban_trong;
                lbltenban.ForeColor     = System.Drawing.Color.MidnightBlue;
            }
            else
            {
                grbBan.Text             = "Busy";
                grbBan.TextColor        = System.Drawing.Color.Maroon;
                grbBan.BorderColor      = System.Drawing.Color.Red;
                ibutton.BackgroundImage = global::Viva_vegan.Properties.Resources.ban_dang_dung;
                lbltenban.ForeColor     = System.Drawing.Color.Maroon;
            }
            // thêm nội dung bên trong groupbox.
            grbBan.Controls.Add(ibutton);
            grbBan.Controls.Add(lbltenban);
            return(grbBan);
        }
示例#3
0
        public void loadBan(String khuvuc)
        {
            flpBan.Controls.Clear();
            List <Ban> bans = new Ban().loadList("");

            if (!String.IsNullOrWhiteSpace(khuvuc))
            {
                bans = new Ban().loadList(khuvuc);
            }
            foreach (Ban item in bans)
            {
                XUICustomGroupbox grbBtn = createCustomBtn(item);
                flpBan.Controls.Add(grbBtn);
            }
        }