我设置的com口怎么不起作用呢?
我用combobox控件做的com口选择,但无论选择那个com口都可以正常运行(串口线连接的是com1口),那位能帮我看一下!谢了 程序代码:
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