How would I say if the yes button on the messagebox was pressed do this,that and the other? In C#.
Your call to MessageBox.Show
needs to pass MessageBoxButtons.YesNo
to get the Yes/No buttons instead of the OK button.
Compare the result of that call (which will block execution until the dialog returns) to DialogResult.Yes
....
if (MessageBox.Show("Are you sure?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
// user clicked yes
}
else
{
// user clicked no
}