I'm unable to figure out the actual dimension of the array and its lenght as the variable size is only declared not defined; meaning it has not been assigned any value yet.
It still has a value; just not one assigned by you. The int named "size" occupies some memory, and that memory has numbers in it. They could be anything. Anything at all. So you've got an array of unknown size. This is a very bad idea.
In C89 it's illegal because array sizes need to be compile-time constants, so variables are not allowed. A conforming compile should give an error message or at the very least a warning when compiling in C89 mode.
In C99 it's allowed to use variables as array sizes, but it's still illegal because size is uninitialized and thus using it invokes undefined behavior.
As a(n irrelevant) side note: it is defined, just not initialized. To declare a variable without defining it, you'd use the extern keyword.
Your second piece of code defines a one-dimensional array of size 5 because 2+3 is 5. A multi-dimensional array would be defined by using multiple pairs of brackets (like int siy).
An uninitialized local variable may contain a trap representation for its type (and thus not a valid value), in which case reading it will invoke undefined behavior (possibly a crash).
Furthermore reading an uninitialized local variable whose address is never taken invokes undefined behavior regardless of whether or not the given type has a trap representation on your implementation.
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 ...