In your first for loop the statement i < wrd[i] should be replaced by either: wrd[i] != NULL or i < strlen(wrd) .
You are comparing i to the character code, which works fine when you are limited to twelve characters, since the lowest printable character is 32 (a space). However, if you went beyond that your code would stop working properly.
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 ...