MessageBoxButtons.YesNo

  • 12 years ago

    Hi! guys 

    how do i check if yes or no was cliked? 

  • 12 years ago

     

    Hopefully, the following code will show you how this is done.... 

    DialogResult myDialogResult;
    myDialogResult = MessageBox.Show("question", "caption", MessageBoxButtons.YesNo);

    if (myDialogResult == DialogResult.Yes)
    {
        //yes was clicked
    }

    if (myDialogResult == DialogResult.No)
    {
        //no was clicked
    }
     

  • 12 years ago

    I have got it already, but thanks for the help anyway

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”