这就是我正在做的,它会导致堆栈溢出,因为它永远来回切换。
private void radioButtonA_CheckedChanged(object sender, EventArgs e)
{
radioButtonB.Checked = !radioButtonB.Checked;
}
private void radioButtonB_CheckedChanged(object sender, EventArgs e)
{
radioButtonA.Checked = !radioButtonA.Checked;
}
必须有更好的方法来做到这一点......
最佳答案
尝试注释掉所有代码,看看它是否按您想要的方式工作。 您不必取消选中代码中的其他单选按钮
关于c# - 在 WinForms 中切换单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4606792/