复选框最基本处理,判断复选框是否被选中。
/// <summary>
/// 复选处理
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked) // 获取选中状态
{
string str = this.label1.Text;
this.label1.Text = str + "苹果";
}
else
{
this.label1.Text = "有:";
}
}