I want to make a MessageBox confirmation. Here is the message box:
MessageBox.Show("Do you want to save changes?", "Confirmation", messageBoxButtons.YesNoCancel);
And I want to make something like this (in pseudocode):
if (MessageBox.Result == DialogResult.Yes)
;
else if (MessageBox.Result == DialogResult.No)
;
else
;
How can I do that in C#?
DialogResult result = MessageBox.Show("Do you want to save changes?", "Confirmation", MessageBoxButtons.YesNoCancel);
if(result == DialogResult.Yes)
{
//...
}
else if (result == DialogResult.No)
{
//...
}
else
{
//...
}