-2

I've got 12 radiobuttons in GroupBox. I want to get id (or value) of this one, which is currently chosen (active). Is there any built-in C# function to do so and I need to write my own one?

TN888
  • 7,659
  • 9
  • 48
  • 84

1 Answers1

0

Get Controls into GroupBox and select checked RadioButton:

var radioButton = groupBox.Controls.OfType<RadioButton>().FirstOrDefault(_ => _.IsChecked).
Vlad
  • 1,377
  • 2
  • 17
  • 29