C# CheckBox Control
Use Of C# CheckBox Control :
CheckBox Control Allow User To Choose Multiple Items From List Of Items.
Important Property Set Of CheckBox Control From Property Window :
Text : Represent String, That String Display With CheckBox Control.
Checked : True/False, If You Set True Then CheckBox Control Display With Checked Mark.
Code To Display User Selected Color In Label Control When User Click On Button
private void button1_Click(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
label1.Text = label1.Text + checkBox1.Text;
}
if (checkBox2.Checked == true)
{
label1.Text = label1.Text + checkBox2.Text;
}
if (checkBox3.Checked == true)
{
label1.Text = label1.Text + checkBox3.Text;
}
}
Output :
No comments:
Post a Comment