Then, if you're not using OS specific libraries, repeat all the above steps on a different operating system.
These are all easy and free ways to significantly improve your code, and they will catch a large percentage of the worst problems. Beyond this, the field expands, and once you have taken these easy, free steps, then look further.
You should also do at least some dynamic analysis of your code. Run it under valgrind on Linux. This will flag up significant memory errors you might be making.
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 ...