精选优质文档-倾情为你奉上VB程序Option ExplicitDim NowX As Integer Dim MaxPlotNo As Long Dim PreValue As Single Private Sub cmbCOM_Click() If cmbCOM.ListIndex + 1 = MSComm1.CommPort Then Exit Sub Timer1.Enabled = False TimeDelay 100 If MSComm1.PortOpen ThenMSComm1.PortOpen = False End If lblMsg.Caption = 已停止检测并关闭通讯端口 cmdOpenCOM.Enabled = True End SubPrivate Sub cmdEnd_Click() EndEnd SubPriva