📌  相关文章
📜  如何在c#代码示例中取消选中单选按钮

📅  最后修改于: 2022-03-11 14:49:03.007000             🧑  作者: Mango

代码示例1
bool isChecked =false;
    private void radioButton1_CheckedChanged(object sender, EventArgs e)
    {
        isChecked = radioButton1.Checked;
    }

    private void radioButton1_Click(object sender, EventArgs e)
    {
        if (radioButton1.Checked && !isChecked)
            radioButton1.Checked = false;
        else
        {
            radioButton1.Checked = true;
            isChecked = false;
        }
    }