1

In my WinForm, I have 4 radio buttons in the same GroupBox

How can I make the 2 radio buttons circled in orange independent of the 2 other radio buttons circled in green?

enter image description here

Thanks

Jack J Jun
  • 5,633
  • 1
  • 9
  • 27
  • 4
    Use different container for each group. The two at top in a panel, the two at the bottom in another panel. – Reza Aghaei Jun 06 '23 at 20:58
  • Look at [this post](https://stackoverflow.com/questions/2178240/how-do-i-group-windows-form-radio-buttons?rq=2). – Mustafa Özçetin Jun 06 '23 at 21:00
  • Thank you, do I have to put them in a container? there is no other solution? – QuickSilvain Jun 06 '23 at 21:20
  • Yes, you have to put each group in a different container; this is how RadioButton works. Unless you want to make your life harder for no reason, and set AutoCheck property of them all to false, and then handle CheckedChanged event of them manually, and check/uncheck other item of group manually. – Reza Aghaei Jun 06 '23 at 22:00

1 Answers1

3

You can use two panels to surround the two radion buttons, like this:

enter image description here

The effect is as follows:

enter image description here

wenbingeng-MSFT
  • 1,546
  • 1
  • 1
  • 8