DialogResult.Yes : DialogResult « System.Windows.Forms « C# / C Sharp by API






DialogResult.Yes

 


using System;
using System.Windows.Forms;

public class MainClass {

    public static void Main() {
        switch (MessageBox.Show("Do you want to create a new file?",
                            "WonderWord",
                            MessageBoxButtons.YesNoCancel,
                            MessageBoxIcon.Question)) {
            case DialogResult.Yes:
                // "Yes" processing
                break;

            case DialogResult.No:
                // "No" processing
                break;

            case DialogResult.Cancel:
                // "Cancel" processing
                break;
        }
    }
}

   
  








Related examples in the same category