Which Radio button in the group is checked?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Using WinForms; Is there a better way to find the checked RadioButton for a group? It seems to me that the code below should not be necessary. When you check a different RadioButton then it knows which one to uncheck… so it should know which is checked. How do I pull that information without doing a lot of if statements (or a switch). RadioButton rb = null; if (m_RadioButton1.Checked == true) { rb = m_RadioButton1; } else if (m_RadioButton2.Checked == true) { rb = m_RadioButton2; } else if (m_RadioButton3.Checked == true) { rb = m