Esempio n. 1
0
        public void LoadDanhMucDoUong()
        {
            int width  = 180;
            int height = 60;

            foreach (var item in bllBanHang.LoadDanhMucDoUong())
            {
                Button btnDanhMuc = new Button();
                btnDanhMuc.Width  = width;
                btnDanhMuc.Height = height;
                btnDanhMuc.Cursor = Cursors.Hand;

                btnDanhMuc.BackColor = bllCaiDat.SelectThemeColor(themeColor);
                btnDanhMuc.Dock      = DockStyle.Top;
                btnDanhMuc.FlatStyle = FlatStyle.Flat;
                btnDanhMuc.FlatAppearance.BorderSize = 0;
                btnDanhMuc.Font      = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                btnDanhMuc.ForeColor = Color.Gainsboro;

                btnDanhMuc.Text = item.TenDanhMuc.ToString();
                btnDanhMuc.Name = item.MaDanhMuc.ToString();

                pnlDanhMuc.Controls.Add(btnDanhMuc);

                btnDanhMuc.Click += btnDanhMuc_Click;
            }
        }