想用VB编写一个上位机界面 遇到问题“未找到方法或数据成员” 到底是怎么回事呢 菜鸟请教大神
附cx:
Dim flag_com_open As Boolean
Dim time_temp As Integer
Dim temp_bufx, temp_bufy As Integer
Private Sub Combo_Com_Click()
On Error Resume Next
x = Combo_Com.Text
m = Len(x)
n = Val(Right$(x, m - 3))
MSComm_Temp.CommPort = n
End Sub
Private Sub Comm_open_Click()
If (flag_com_open = False) Then
Comm_open.Caption = "关闭端口"
flag_com_open = True
If MSComm_Temp.PortOpen = False Then
MSComm_Temp.PortOpen = True
End If
Timer1.Enabled = True
Else
Comm_open.Caption = "打开端口"
MSComm_Temp.PortOpen = False
flag_com_open = False
Timer1.Enabled = False
End If
End Sub
Private Sub Form_Load()
Dim i As Integer
Timer1.Enabled = False
Timer1.Interval = 1000
temp_bufx = 0
temp_bufy = 5500
Templine.AutoRedraw = True
Templine.DrawStyle = 2
For i = 250 To 6250 Step 500
Templine.Line (0, i)-(9250, i)
Next i
Templine.DrawStyle = 0
For i = 1 To 16
Combo_Com.AddItem "COM" & i
Next i
MSComm_Temp.Settings = "9600,N,8,1"
MSComm_Temp.OutBufferSize = 0
MSComm_Temp.InBufferSize = 0
MSComm_Temp.InputMode = comInputModeText
MSComm_Temp.RThreshold = 4
MSComm_Temp.SThreshold = 1
MSComm_Temp.InputLen = 0
MSComm_Temp.InBufferCount = 0
End Sub
Private Sub MSComm_Temp_OnComm()
Dim a As String
Dim temp As Integer
If MSComm_Temp.CommEvent = comEvReceive Then
a = MSComm_Temp.Input
For i = 1 To 4
temp = temp * 10 + Val(Mid(a, i, 1)) '
Next i
Templine.Line (temp_bufx, temp_bufy)-(time_temp * 50, 8250 - temp), vbRed
temp_bufx = time_temp * 50
temp_bufy = 8250 - temp
time_temp = time_temp + 1
End If
End Sub
Private Sub Timer1_Timer()
MSComm_Temp.Output = Chr(&H30)
End Sub