In this example, a user has clicked on a 'delete' button and I wish to confirm the deletion first:
private void button3_Click(object sender, System.EventArgs e)
{
if (MessageBox.Show("Really delete?","Confirm delete", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
// a 'DialogResult.Yes' value was returned from the MessageBox
// proceed with your deletion
}
}
That's it - what could be simpler?
christo
follow me on twitter: http://www.twitter.com/planet_guru