Don't use static in a public class member. Public means it's accessable to the outside world, but static limits it too the segment of code where you've declared it. If you want to hide it from other peices of code put it in a protected or private section of the class.
>Public means it's accessable to the outside world, but static limits it too the segment of code where you've declared it.
You're mixing up your statics. :) static is overloaded for too many different uses. In a class declaration, static means that the name belongs to the class and not to individual objects. In a function definition, static means that the variable being declared has static storage duration. In the global scope, static is a deprecated feature that forces internal linkage.
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 ...