Display Question messagebox and check its result
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; public class Test{ [STAThread] static void Main() { DialogResult reply = MessageBox.Show("Question?", "Yes or No Demo",MessageBoxButtons.YesNo,MessageBoxIcon.Question); if (reply == DialogResult.Yes){ MessageBox.Show("Yes"); } else { MessageBox.Show("No"); } } }
1. | Yes No Cancel | ||
2. | MessageBox Options | ||
3. | MessageBox with OK button and information icon | ||
4. | Message box builder | ||
5. | Information message box | ||
6. | A message box |