private void btnTrangChinh_Click(object sender, EventArgs e) { if (!Check("frmTrangChinh")) { pnlChucnang.Controls.Clear(); pnlChucnang.AutoScroll = true; for (int i = 0; i < 4; i++) { Button btn = new Button(); btn.Location = new Point(0, i * 35 + 2); btn.Text = listHome[i]; btn.TextAlign = ContentAlignment.MiddleLeft; btn.Visible = true; btn.Size = new Size(135, 35); btn.FlatStyle = FlatStyle.Flat; btn.FlatAppearance.BorderSize = 0; btn.FlatAppearance.BorderColor = Color.White; btn.Image = new Bitmap(global::GUI.Properties.Resources.Home__1_); btn.ImageAlign = ContentAlignment.MiddleLeft; btn.TextImageRelation = TextImageRelation.ImageBeforeText; btn.Click += new System.EventHandler(btn_click); pnlChucnang.Controls.Add(btn); } return; } Form fr = new frmTrangChinh(); fr.MdiParent = this; int Heights = Screen.PrimaryScreen.Bounds.Height; int Widths = Screen.PrimaryScreen.Bounds.Width; this.Location = new Point(0, 0); this.Width = Widths; this.Height = Heights - 40; fr.Show(); }
private void frmChinh_Load(object sender, EventArgs e) { //Show or Hide XNT xuToolStripMenuItem.Visible = Utils.ShowXnt; xuấtnhậptồnTheoKhoToolStripMenuItem.Visible = Utils.ShowXnt; xuấtnhậptồnTheoLoạiHàngToolStripMenuItem.Visible = Utils.ShowXnt; xuấtnhậptồnTheoToolStripMenuItem.Visible = Utils.ShowXnt; if (Luu.Server.Equals("server")) { toolStripMenuItem5.Visible = true; } else if (Luu.Server.Equals("client")) { toolStripMenuItem5.Visible = false; } Size s = new System.Drawing.Size(); s = SystemInformation.WorkingArea.Size; tlsUs.Text = "Người sử dụng: " + Common.Utilities.User.TenNhanVien; Form fr = new frmTrangChinh(); fr.MdiParent = this; this.Height = Int32.Parse(s.Height.ToString()); this.Width = Int32.Parse(Screen.PrimaryScreen.WorkingArea.Width.ToString()); fr.Show(); pnlChucnang.Visible = true; pnlChucnang.Location = new Point(1, 15); pnlChucnang.Size = new Size(166, 200); pnlChucnang.AutoScroll = true; groupBox1.Controls.Add(pnlChucnang); listHome[0] = "Đăng Xuất"; listHome[1] = "Lưu viết hệ thống"; listHome[2] = "Khôi phục dữ liệu"; listHome[3] = "Phân quyền"; listDanhMuc[0] = "Nhóm Hàng"; listDanhMuc[1] = "Loại Hàng Hóa"; listDanhMuc[2] = "Hàng Hóa"; listDanhMuc[3] = "Khoản Mục Thu Chi"; //listDanhMuc[4] = "TK Kế Toán"; //listDanhMuc[5] = "Nhóm TKKT"; listDanhMuc[4] = "Thuế"; listDanhMuc[5] = "Nhà Cung Cấp"; listDanhMuc[6] = "Khách Hàng"; listDanhMuc[7] = "Phòng Ban"; listDanhMuc[8] = "Nhân Viên"; listDanhMuc[9] = "Kho Hàng"; listDanhMuc[10] = "Tiền Tệ"; listDanhMuc[11] = "Đơn Vị Tính"; listDanhMuc[12] = "Gói Hàng"; //listDanhMuc[13] = "Quy Đổi DVT"; listKhoHang[0] = "Điều chuyển kho"; listKhoHang[1] = "Xác nhận điều chuyển kho"; listKhoHang[2] = "Kiểm kê kho"; listKhoHang[3] = "In tem mã vạch"; //listKhoHang[4] = "Nhập số dư tồn kho"; //listKhoHang[4] = "Chuyển số dư tồn kho"; listKhoHang[4] = "Số Dư Kho"; listKhoHang[5] = "Phiếu Xuất Hủy"; listKhoHang[6] = "Xác Nhận Phiếu Xuất Hủy"; listNghiepVu[0] = "Phiếu Thu"; listNghiepVu[1] = "Phiếu Chi"; listNghiepVu[2] = "Sổ Quỹ"; listNghiepVu[3] = "Khách hàng trả lại"; listNghiepVu[4] = "Trả lại NCC"; listNghiepVu[5] = "Số Dư Đầu Kỳ"; listNghiepVu[6] = "Kết Chuyển Số Dư Đầu Kỳ"; listNghiepVu[7] = "Đơn đặt hàng"; listNghiepVu[8] = "Nhập kho"; listNghiepVu[9] = "Bán Buôn"; listNghiepVu[10] = "Bán Lẻ"; listBaoCao[0] = "BC Doanh thu"; listBaoCao[1] = "BC Công nợ"; listBaoCao[2] = "BC Xuất hàng"; listBaoCao[3] = "BC Nhập hàng"; listBaoCao[4] = "BC Tồn kho"; }