//private void _ShowWaitForm() private void _ShowWaitForm(object ParentForm) { try { //waitForm = new BusyForm(); waitForm = new BusyForm((Form)ParentForm); waitForm.ShowDialog(); } catch (ThreadAbortException) { waitForm.Close(); Thread.ResetAbort(); } }
/// <summary> /// 创建等待窗体 /// </summary> //public void _CreateForm() public void _CreateForm(Form ParentForm) { waitForm = null; //waitThread = new Thread(new ThreadStart(this._ShowWaitForm)); //waitThread = new Thread(new ThreadStart(this._ShowWaitForm(ParentForm))); //waitThread.Start(); Thread waitThread = new Thread(new ParameterizedThreadStart(this._ShowWaitForm)); waitThread.Start(ParentForm); //启动异步线程 Thread.Sleep(100); }