protected override void OnClosed(EventArgs e) { client.Disconnect(); base.OnClosed(e); //Application.Current.Shutdown(); }
private void exit_ButtonClick(object sender, EventArgs e) { try { client.Disconnect(); } catch { } //this.Close(); //Environment.Exit(Environment.ExitCode); //InitializeComponent(); Application.Exit(); Environment.Exit(Environment.ExitCode); InitializeComponent(); }