private void CloseWindow() { if (this.InvokeRequired) { CloseWindowCallback callback = new CloseWindowCallback(CloseWindow); this.Invoke(callback); } else { this.Close(); } }
private void CloseWindow() { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.appProgressBar.InvokeRequired) { CloseWindowCallback d = new CloseWindowCallback(CloseWindow); this.Invoke(d); } else { this.Close(); } }
private void CloseWindow() { try { if (this.InvokeRequired) { CloseWindowCallback d = new CloseWindowCallback(CloseWindow); this.Invoke(d); } else { this.Closing -= new System.ComponentModel.CancelEventHandler(this.Form1_Closing); this.Close(); Application.Exit(); } } catch { } }