Oh i all most forgot comm port is +10 V when he gives signal and -10V when hes not active.
Correction of command for activation MSComm.portopen = true and voltage between pins 5-7 will be +10V when its disabled voltage will be -10V you will need some electronics to make it 0-10, diode and drive relay with transistor and external power supplay just to make sure u dont burn serial port.
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 ...