The first backslash is an escape character, just like when you type \n you are escaping the character n and qualifying that it's a newline. So say you had for example mydir\name in your directory string (or any string for that matter) you then have to escape the \ character to tell it you just want the backslash.
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 ...