Hi friends,in this post i would like to explain Example on Switch Condition in C#.Net.
* Open windows application.
* Place a TextBox & a Button on to the form.
* Code under button_Click event:
Thank You...
* Open windows application.
* Place a TextBox & a Button on to the form.
* Code under button_Click event:
{
int j=int.Parse(textBox1.Text);
Switch(j)
{
Case 1 : this.BackColor=Color.Green;
break;
Case 2 : ColorDialog clrd=new ColorDialog();
clrd.ShowDialog();
this.BackColor=cd.Color;
break;
Case 3 : Application.Exit();
break;
default : MessageBox.Show("Please enter 1,2 or 3");
break;
}//End of switch.
}//End of button_Click event.
Thank You...