A situation happened
this.FormClosing += btn_close_Click; void btn_close_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "realy exit?", "closing program", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.Close(); } } After the modal window, the program still turns off.
Tell me how to fix it.
elseande.Cancel = true;Yes, and in the event handler you should have not justEventArgs e, but what should be. - Bulson