private void Tracuubutton_Click(object sender, EventArgs e) { TraCuu TC = new TraCuu(); this.Visible = false; TC.ShowDialog(); this.Visible = true; }
// Function to call an Search BillID userControll (TraCuu) private void billToolStripMenuItem_Click(object sender, EventArgs e) { TraCuu open = new TraCuu("Tra cứu hóa đơn", api); this.Controls.Add(open); open.Left = (this.ClientSize.Width - open.Width) / 2; open.Top = (this.ClientSize.Height - open.Height) / 2; open.BringToFront(); }
private void btnTraCuuNhanSu_Click(object sender, RoutedEventArgs e) { if (frmTraCuu == null) { frmTraCuu = new TraCuu(); } // you need to take care of form closing because the object being disposed) frmTraCuu.Closed += delegate { frmTraCuu = null; }; if (frmTraCuu.WindowState == WindowState.Minimized) { frmTraCuu.WindowState = WindowState.Normal; } frmTraCuu.Show(); frmTraCuu.Activate(); }
private frmInputBarcode(XtraForm main, TraCuu traCuu, ThucHien thucHien, CapNhatGiaTriKhiBarCodeHopLe capNhat, BarcodeInputType type) { InitializeComponent(); this._SoLg = "1"; this._TraCuu = traCuu; this._ThucHien = thucHien; this._CapNhatGiaTriKhiBarCodeHopLe = capNhat; if(type == BarcodeInputType.TYPE1){ this.barCode.KeyUp += new System.Windows.Forms.KeyEventHandler(this.barCode_KeyUp2); this.Slg.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Slg_KeyUp2); this.FormClosing += new FormClosingEventHandler(this.frmInputBarcode__FormClosing); this.Slg.TextChanged += new EventHandler(Slg_TextChanged); } this.Top = main.Top; this.Left = main.Left + (main.Width - this.Width) / 2; PLKey key = new PLKey(this); key.Add(Keys.F5, delegate(){ this.Close(); }); }