private void btnDatPhong_Click(object sender, EventArgs e) { UserDatPhong userControl = new UserDatPhong(MaPhong); if (!pnlForm.Controls.Contains(userControl)) { pnlForm.Controls.Add(userControl); userControl.Dock = DockStyle.Fill; userControl.BringToFront(); } else { userControl.BringToFront(); } }
private void btnDatPhong_Click(object sender, EventArgs e) { if (ClickbtnThanhToan == 1) { userThanhToan.XoaHoaDon(); ClickbtnThanhToan = -1; } UserDatPhong userControl = new UserDatPhong(MaPhong); if (!pnlForm.Controls.Contains(userControl)) { pnlForm.Controls.Add(userControl); userControl.Dock = DockStyle.Fill; userControl.BringToFront(); } else { userControl.BringToFront(); } }