Clyde Eisenbeis

Clyde Eisenbeis

  • 1.7k
  • 79
  • 13.5k

How do I retrieve every RadioButton in the GroupBox?

Dec 1 2024 6:51 PM

XAML

<GroupBox Name="FirstGroupBox"
            Header="1st"
            Margin="10,0,5,0"
            Height="auto"
            Width="auto"
            >
  <RadioButton x:Name="gRBuResearcher1" Content ="Researcher"  Click="gRBuResearcher1_Click" />
  <RadioButton x:Name="gRBuScientist1" Content="Scientist" Click="gRBuScientist1_Click" />
  <RadioButton x:Name="gRBuMedic1" Content="Medic" Click="gRBuMedic1_Click" />
</GroupBox>

xaml.cs

foreach (RadioButton rb in GroupBox:Name FirstGroupBox)) { 
}

does not work.  How do I retrieve every RadioButton in the GroupBox?

 

 


Answers (1)