CheckBox control example

CheckBox control example

Previous Home Next

 

The CheckBox control is used to display a check box.

 
    

   

 .......Desining code for cheackbox 1,2,3...........................
...................................................................

       
        
              
        
....................................................................
.................designing code for button..........................
....................................................................

....................................................................
....................Designing code for Textbox.....................
....................................................................

....................................................................

......................CS code for button click.....................
..................................................................
 protected void Button1_Click(object sender, EventArgs e)
    {

        {
            string s = "";

            if (CheckBox1.Checked)
            {
                s =s+ CheckBox1.Text.ToString()+"\n";
            
            }
            if (CheckBox2.Checked)
            {
                s = s + CheckBox2.Text.ToString() + "\n";

            }
            if (CheckBox3.Checked)
            {
                s = s + CheckBox3.Text.ToString() +;

            }
            TextBox1.Text = s;
        }

    }
...................................................................
Previous Home Next