Yes it is possible to have an array as a class member. However, in all arrays in C++, the number of elements must be a compile-time constant. In the code you cited, you tried to define an array with i elements, where i is a variable that changes at run time. C++ doesn't allow this.
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 ...