radiobutton 按钮 点击和取消

bool isChecked = false;
        private void rdbWhetherSave_CheckedChanged(object sender, EventArgs e)
        {
            isChecked = rdbWhetherSave.Checked;
        }        
        private void rdbWhetherSave_Click(object sender, EventArgs e)
        {
            if (rdbWhetherSave.Checked && !isChecked)
                rdbWhetherSave.Checked = false;
            else
            {
                rdbWhetherSave.Checked = true;
                isChecked = false;
            }
        }

你可能感兴趣的:(radiobutton 按钮 点击和取消)