Thursday 29 November 2012

C# RadioButton Control

Use Of C# RadioButton Control : 

           RadioButton Control Allow User To Choose Single Items From List Of Items.

Important Property Set Of  RadioButton Control From Property Window :

               Text : Represent String, That String Display With RadioButton Control.

               Checked : True/False, If You Set True Then RadioButton Control Display With Checked Mark.

 

Code To Display User Selected Favourite Bird In Label Control When User Click On Button

 

        private void button1_Click(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                label1.Text = "Your Favourite Birds : " + radioButton1.Text;
            }
            if (radioButton2.Checked == true)
            {
                label1.Text = "Your Favourite Birds : " + radioButton2.Text;
            }
            if (radioButton3.Checked == true)
            {
                label1.Text = "Your Favourite Birds : " + radioButton3.Text;
            }
        }

Output :

.net Examples

 

No comments:

Post a Comment