![]() |
#2
Artless2013-03-07 12:25
|

Private Sub Combo1_Change() '下拉菜单,选择COM口
Dim COM As String
If Combo1.Text = "COM1" Then
COM = 1
ElseIf Combo1.Text = "COM2" Then
COM = 2
'ElseIf Combo1.Text = "COM3" Then
' = "COM3"
'ElseIf Combo1.Text = "COM4" Then
' = "COM4"
'ElseIf Combo1.Text = "COM5" Then
' = "COM5"
'ElseIf Combo1.Text = "COM6" Then
' = "COM6"
'ElseIf Combo1.Text = "COM7" Then
' = "COM7"
'ElseIf Combo1.Text = "COM8" Then
' = "COM8"
'ElseIf Combo1.Text = "COM9" Then
' = "COM9"
Else
End If
If MSComm1.PortOpen = True Then
= COM
End If
End Sub
Dim COM As String
If Combo1.Text = "COM1" Then
COM = 1
ElseIf Combo1.Text = "COM2" Then
COM = 2
'ElseIf Combo1.Text = "COM3" Then
' = "COM3"
'ElseIf Combo1.Text = "COM4" Then
' = "COM4"
'ElseIf Combo1.Text = "COM5" Then
' = "COM5"
'ElseIf Combo1.Text = "COM6" Then
' = "COM6"
'ElseIf Combo1.Text = "COM7" Then
' = "COM7"
'ElseIf Combo1.Text = "COM8" Then
' = "COM8"
'ElseIf Combo1.Text = "COM9" Then
' = "COM9"
Else
End If
If MSComm1.PortOpen = True Then
= COM
End If
End Sub