Glad I could help.
In the future you may want to explain more of your issue so that others may have the opportunity to learn more as well.
My explanation, while it worked for you may not always be the best practice so the more info you present, the more others might chime in with other options. We're all about learning more here and sharing concept and ideas. Someone also may add more information that would help and others.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...