public static void Show(string waitMsg, IWin32Window owner) { OwnerForm = (Form)owner; OwnerForm.Enabled = false; if (form == null) { form = new waitform(); ThreadPool.QueueUserWorkItem(state => { form.ShowDialog(); }); //DeleShow DS = form.Show; //form.Enabled = false; //IAsyncResult result = DS.BeginInvoke(null, GetResultCallBack, owner); } form.Msg = waitMsg; }
public static void Close() { if (form != null) { Application.DoEvents(); OwnerForm.Enabled = true; form.Close(); } form = null; }