Code:
Dim textout, textin As String Private Sub cmdcom_Click() If cmdcom.Caption = "CONNECTOR" Then com1.CommPort = Val(cmbsel.ListIndex + 1) com1.PortOpen = True cmdsend.Visible = True Timer1.Enabled = True cmdcom.Caption = "DECONNECT" Else If cmdcom.Caption = "DECONNECT" Then Timer1.Enabled = False cmdsend.Visible = False com1.PortOpen = False cmdcom.Caption = "CONNECTOR" End If End If End Sub Private Sub cmdsend_Click() textout = textsend.Text com1.Output = textout End Sub Private Sub Timer1_Timer() textin = com1.Input If textin <> "" Then lbstar.Caption = textin End If End Sub