Radiobuttons as a group in different panels

…衆ロ難τιáo~ 提交于 2019-12-19 06:51:20

问题


I'm using C# to develop WindowsForms application. I have created a form with some panels. Each panel has a RadioButton. When I click a RadioButton, and then other one, both are checked.

How could I simulate that all the RadioButtons are in the same group, so only one can be checked, and the others are unchecked?

Of course, I can control the checkedChanged event for each RadioButton ... but is there any better solution?

Thanks in advance.


回答1:


RadioButtons are automatically linked if they are inside the same parent. Since you want them to live in different containers you will have to link them manually.



来源:https://stackoverflow.com/questions/5727415/radiobuttons-as-a-group-in-different-panels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!