1
2
3
4
5
6
7
8
9
|
// zum Beispiel im Form Load Event eisetzen
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult result = MessageBox.Show("Sind Sie sicher?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.No)
e.Cancel = true;
}
|