Lets have a look at the code snippet
DialogResult dResTest;
dResTest = MessageBox.Show( "Do you want to add something ?", "Confirm Document Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dResTest == DialogResult.No)
{
Application.Exit();
}
else
{
//Calling some function if user clicks Yes
ViewExistingTicket ();
}
Just use the intelliscense feature, you'll find some other useful properties after giving dot to MessageBoxButtons and MessageBoxIcon
No comments:
Post a Comment