The problem is that the messagebox with \"sure you wanna close?\" does pop up, but when I click \"no\", it still proceeds to close the program. Any suggestions? Here\'s my c
The question is now old but this way is more simple and short, and I think it can be useful to those who arrive on this page:
protected override void OnFormClosing(FormClosingEventArgs e)
{
if (MessageBox.Show("Are you sure that you would like to cancel the installer?", "Cancel Installer", MessageBoxButtons.YesNo) == DialogResult.No)
{
e.Cancel = true;
}
}
and use elsewhere this.Close() rather than a function.