问题
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