public void CloseForm() { if (this.waitThread != null) { try { this.waitFM.SetText("close"); this.waitThread = null; this.waitFM = null; } catch (Exception) { } } }
public void CreateForm(string text) { if (this.waitThread != null) { try { this.waitThread = null; this.waitFM = null; } catch (Exception) { } } this.waitThread = new Thread((ParameterizedThreadStart) delegate { this.waitFM = new waitForm(text); Application.Run(this.waitFM); }); this.waitThread.Start(); }