DialogResult dr = MessageBox.Show("Are you happy now?",
"Mood Test", MessageBoxButtons.YesNo);
switch(dr)
{
case DialogResult.Yes:
break;
case DialogResult.No:
break;
}
dynamic MsgResult = this.ShowMessageBox("Do you want to cancel all pending changes ?", "Cancel Changes", MessageBoxOption.YesNo);
if (MsgResult == System.Windows.MessageBoxResult.Yes)
{
enter code here
}
else
{
enter code here
}
if (System.Windows.Forms.MessageBox.Show
("Are you sure you want to add the audit?", "Add",
System.Windows.Forms.MessageBoxButtons.YesNo,
System.Windows.Forms.MessageBoxIcon.Question)
==System.Windows.Forms.DialogResult.Yes)
// Do stuff after 'YES is clicked'
else
// DO stuff after 'NO is clicked'
if (MessageBox.Show("Please confirm before proceed" + "\n" + "Do you want to Continue ?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
//do something if YES
}
else
{
//do something if NO
}