using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace switch_dialog
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("How are you?", "Hi",MessageBoxButtons.OKCancel);
switch (result)
{
case DialogResult.OK:
{
this.Text = "[OK]";
break;
}
case DialogResult.Cancel:
{
this.Text = "[Cancel]";
break;
}
}
}
}
}