Quote Originally Posted by _powerade_ View Post
I think Inferrd got a point when he says that the Radiobuttons might actually not be where you think they are.

JMC have posted a nice snippet in this thread that iterates through every sub control. Based on that example, what happen if you change your function to this?

vb.net Code:
  1. Private Function WhatRadioIsSelected(ByVal MainPanel As Panel) As String 'Note that it is iterating through the main panel controls and its child controls
  2.     Dim result As String = Nothing
  3.  
  4.     Dim ctl As Control = MainPanel.GetNextControl(MainPanel, True) 'Get the first control in the tab order.
  5.  
  6.     Do Until ctl Is Nothing
  7.         If TypeOf ctl Is GroupBox Then
  8.             For Each ControlInGroupBox As Control In DirectCast(ctl, GroupBox).Controls.OfType(Of RadioButton)
  9.                 If DirectCast(ControlInGroupBox, RadioButton).Checked = True Then result = ControlInGroupBox.Text
  10.             Next
  11.         End If
  12.  
  13.         ctl = MainPanel.GetNextControl(ctl, True) 'Get the next control in the tab order.
  14.     Loop
  15.  
  16.     Return result
  17. End Function

Instead of using the groupbox as a parameter, use the main panel instead.
vb.net Code:
  1. Messagebox.Show(WhatRadioIsSelected(pnlMainPanel))

Also I agree with Sytten, using a Usercontrol will result in a much lighter coding experience, and in my opinion adding and removing several controls and their event handlers in run time should only be used in special cases. I include a project related to your issue (which is slightly overkill for demonstrating purposes) where everything is designed in run time. The project only got a few controls, but image if there where tens or hundreds of them You can compare for yourself why the Usercontrol example is a good example
Going to try both. Be back. Thank you.