Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Simple Yes No box

Does C# have available a simple Yes No Cancel dialog that I can bring up to ask a question and let the user decide?

Then when it closes I want to detect a Yes   No   or   Cancel    response.........and act accordingly.

Simple question but I would like it pretty fast....and hold the onions.
0
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
TertioptusCommented:
Try the follow, and make sure you are using the System.Windows.Forms namespace:


if(MessageBox.Show("Click Ok or Cancel", "My yes or no box",MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
{
      //Do it
}

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now