1using System;
2using System.Drawing;
3using System.Windows.Forms;
4
5namespace WindowsFormsApplication1
6{
7 public partial class Form1 : Form
8 {
9 public Form1()
10 {
11 InitializeComponent();
12 }
13
14 private void Form1_Load(object sender, EventArgs e)
15 {
16 radioButton1.Checked = true;
17 }
18
19 private void button1_Click(object sender, EventArgs e)
20 {
21 if (radioButton1.Checked == true)
22 {
23 MessageBox.Show ("You are selected Red !! ");
24 return;
25 }
26 else if (radioButton2.Checked == true)
27 {
28 MessageBox.Show("You are selected Blue !! ");
29 return;
30 }
31 else
32 {
33 MessageBox.Show("You are selected Green !! ");
34 return;
35 }
36 }
37 }
38}