GroupBox Selected

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a Windows GroupBox (m_groupBox) on a form which acts as a filter and
contains 26 filter radiobuttons (m_radioButtonA through m_radioButtonZ).

How can I check in code which radiobutton has been selected? There does not
seem to be a property in the groupBox for this.

Thanks
 
Use the following code,

for(int i=0;i<groupBox1.Controls.Count;i++)
{
if (((RadioButton) groupBox1.Controls).Checked)
MessageBox.Show(((RadioButton) groupBox1.Controls).Text);
}
 
Back
Top