Radiobuttons as a group in different panels
Asked Answered
A

1

6

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.

Assiut answered 20/4, 2011 at 8:17 Comment(0)
K
2

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.

Kirstiekirstin answered 20/4, 2011 at 9:10 Comment(1)
Thanks for your answer. In Java workd, I saw a RadioGroup class that links, and I was guessing if there was a similar class in C#. I'll write the logic using the CheckedChanged event. Thanks!Dichotomous

© 2022 - 2024 — McMap. All rights reserved.