private void LinkClick(object sender, ItemClickEventArgs e) { try { string Chinh = e.Item.Name.ToString(); if (ModifierKeys == Keys.Control && Chinh == "DaiLy") { } else { foreach (var form in MdiChildren.Where(frm => frm.GetType().Name == "frm" + Chinh)) { form.Activate(); return; } } XuLyGiaoDien.wait.ShowWaitForm(); var f = Activator.CreateInstance(Type.GetType(string.Format("CRM.frm{0}", Chinh), true)) as XtraForm; f.MdiParent = this; f.Text = e.Item.Caption; f.Show(); GridViewHelper.SetFromGrid(f); XuLyGiaoDien.FlushMemory(); } catch { XtraMessageBox.Show("Chức năng chưa được tích hợp hoặc đang bảo trì"); } if (XuLyGiaoDien.wait.IsSplashFormVisible) { XuLyGiaoDien.wait.CloseWaitForm(); } }
public static void OpenForm(Form frm) { new Thread(() => { frm.KeyPreview = true; for (double i = 0; i <= 1; i += 0.1) { frm.Invoke(new MethodInvoker(() => { frm.Opacity = i; })); Thread.Sleep(10); } frm.KeyDown += (s, e) => { if (e.Control && e.KeyCode == Keys.D1 && !frm.Name.Equals("frmChinh")) { using (var g = new Bitmap(frm.Width, frm.Height)) { frm.DrawToBitmap(g, new Rectangle(0, 0, g.Width, g.Height)); Clipboard.SetImage(g); if (!wait.IsSplashFormVisible) { wait.ShowWaitForm(); } wait.SetWaitFormCaption("Thông báo"); wait.SetWaitFormDescription("Đã sao chép hình ảnh"); Thread.Sleep(500); if (wait.IsSplashFormVisible) { wait.CloseWaitForm(); } } } else if (e.Control && e.KeyCode == Keys.D2) { frm.TopMost = true; Bitmap g; if (frm.Name.Equals("frmChinh")) { g = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); Graphics graphics = Graphics.FromImage(g as Image); graphics.CopyFromScreen(0, 0, 0, 0, g.Size); } else { g = new Bitmap(frm.Width, frm.Height); frm.DrawToBitmap(g, new Rectangle(0, 0, g.Width, g.Height)); } new Snipping(g).ShowDialog(frm); } }; GridViewHelper.SetFromGrid(frm); }).Start(); }
public frmCongNoPhu(string A, DateTime dtp1s, DateTime dtp2s) { InitializeComponent(); GridViewHelper.SetFromGrid(this, GCCN, GVCN); dtp1.EditValue = dtp1s; dtp2.EditValue = dtp2s; lstCongNo = new D_GIAODICH().LayDanhSachCN(dtp1.DateTime, dtp2.DateTime, A); giaoDichOBindingSource.DataSource = lstCongNo; }
public frmCongNoPhu(O_DAILY dl) { InitializeComponent(); GridViewHelper.SetFromGrid(this, GCCN, GVCN); daiLyO = dl; dtp1.EditValue = DateTime.ParseExact("01/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString(), "d/M/yyyy", null); dtp2.EditValue = (DateTime.Today.Day == 1) ? DateTime.Today : DateTime.Today; DuLieu(); Text += " " + dl.Ten; }
private void frmChinh_Load(object sender, EventArgs e) { if (!XuLyGiaoDien.wait.IsSplashFormVisible) { XuLyGiaoDien.wait.ShowWaitForm(); } XuLyGiaoDien.OpenForm(this); PhanQuyenHienThi(); RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\THCRM"); chlDG.Checked = !(key.GetValue("TKNC").ToString().ToLower() == "true"); Bdpi.Caption = "KPI: " + DuLieuTaoSan.NV.Diem; if (DuLieuTaoSan.Q.Lv2Ve) { frmVe f = new frmVe(); f.MdiParent = this; f.Show(); GridViewHelper.SetFromGrid(f); tabbedView1.Documents[0].Properties.AllowClose = DevExpress.Utils.DefaultBoolean.False; } }
public frmCongNo() { InitializeComponent(); GridViewHelper.SetFromGrid(this, GCCN, GVCN); }
public frmChinhSach() { InitializeComponent(); GridViewHelper.SetFromGrid(this, GCCTCS, GVCTCS); }
public frmHoaDonGui() { InitializeComponent(); GridViewHelper.SetFromGrid(this, GCHD, GVHD); }