Well, Borland doesn't do it through magic, so there is a way to do it without their functions. For instance, if you are on Windows you would use SetConsoleCursorPosition instead of gotoxy, GetConsoleScreenBufferInfo instead of wherex and wherey, and SetConsoleTextAttribute instead of whatever you would use to set the color. Let me know if you need more info.
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 ...