You'll find the link for "mark this thread solved" at the end of the thread.
You override equals for a class where you want different objects to be treated as equal according to some criteria that you define. Eg two Strings are equal if they contain exactly the same sequence of characters. It's up to you to decide exactly what values you want to compare before you decide that two objects are "equal"
I don't understand your last question about "only one code"
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 ...