public Form_InputLotId() { InitializeComponent(); DialogResult = DialogResult.Cancel; this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath); Instance = this; }
/// <summary> /// 显示本窗体的一个模态窗体实例 /// </summary> public static void ShowDialogForm() { Form_InputLotId frm = Form_InputLotId.Instance; if (frm != null) { if (!frm.IsDisposed) { Form_InputLotId.Instance.Dispose(); } } Form_InputLotId.Instance = new Form_InputLotId(); frm = Form_InputLotId.Instance; int SH = Screen.PrimaryScreen.Bounds.Height; int SW = Screen.PrimaryScreen.Bounds.Width; //frm.Location = new Point((SW - frm.Size.Width) / 2, (SH - frm.Size.Height) / 2); frm.StartPosition = FormStartPosition.CenterParent; //App.mainWin.Enabled = false; Form_InputLotId.Instance.textBox1.Focus(); frm.ShowDialog(); //App.mainWin.Enabled = true; }