Are you developing a windows application or web application? @timmyjoshua
I am asking that because, I also used the similiar code as @ss125 posted in the above post. Its used for the web application. If you want a windows application code, you have to mention that in your question itself.
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 ...