Home > Articles > .Net Framework Articles > How to create a message box with “Yes”, “No” options and a DialogResult in C#?

How to create a message box with “Yes”, “No” options and a DialogResult in C#?

by John Prathip   on Dec 15, 2015   Category: .Net Framework  | Level: Intermediate  |  Views: 688    |  Points: 100   
Like this article? Bookmark and Share:
How to create a message box with “Yes”, “No” options and a DialogResult

DialogResult dialogResult = MessageBox.Show("you want me to open this excel sheet for you ?", "Some Title", MessageBoxButtons.YesNo);

if(dialogResult == DialogResult.Yes)

{

    //do something

}

else if (dialogResult == DialogResult.No)

{

    //do something else

}



Like this article? Bookmark and Share:

Most viewed Articles

User Comments


No response found, be the first to review this article.

Submit feedback about this article

Please sign in to post feedback

Latest Posts