复选框处理

复选框最基本处理,判断复选框是否被选中。

 /// 
        /// 复选处理
        /// 
        /// 
        /// 
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)  // 获取选中状态
            {
                string str = this.label1.Text;
                this.label1.Text = str + "苹果";
            }
            else
            {
                this.label1.Text = "有:";
            }
        }

你可能感兴趣的:(c#学习)