I want to make a MessageBox confirmation. Here is the message box:
MessageBox.Show(\"Do you want to save changes?\", \"Confirmation\", messageBoxButtons.YesNoCan
Rather than using if statements might I suggest using a switch instead, I try to avoid using if statements when possible.
var result = MessageBox.Show(@"Do you want to save the changes?", "Confirmation", MessageBoxButtons.YesNoCancel);
switch (result)
{
case DialogResult.Yes:
SaveChanges();
break;
case DialogResult.No:
Rollback();
break;
default:
break;
}