标题:我设置的com口怎么不起作用呢?
取消只看楼主
wxl900306
Rank: 1
等 级:新手上路
帖 子:26
专家分:2
注 册:2012-3-14
结帖率:85.71%
已结贴  问题点数:20 回复次数:0 
我设置的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

搜索更多相关主题的帖子: com 
2013-03-07 10:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-399983-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.147386 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved