我编了个程序如下“Option ExplicitPrivate Sub Form_Load()
MSComm1.CommPort = 1
MSComm2.CommPort = 2
MSComm1.InputMode = comInputModeBinary
MSComm2.InputMode = comInputModeBinary
MSComm2.PortOpen = True
MSComm1.PortOpen = True
MSComm1.OutBufferCount = 0
MSComm2.InBufferCount = 0
mscomm2.RThreshold=1
End SubPrivate Sub MSComm2_OnComm()
Select Case MSComm2.CommEvent
Case comEvReceive
Dim i() As Byte
i = MSComm2.Input
Label1.Caption = StrConv(i, vbUnicode)
End Select
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MSComm1.Output = Text1.Text
End If
End Sub当我在text中输入8个以下英文字母时,label可以完整显示,而text中大于8个时,label只显示第8个字母以后的,这是为什吗?
MSComm1.CommPort = 1
MSComm2.CommPort = 2
MSComm1.InputMode = comInputModeBinary
MSComm2.InputMode = comInputModeBinary
MSComm2.PortOpen = True
MSComm1.PortOpen = True
MSComm1.OutBufferCount = 0
MSComm2.InBufferCount = 0
mscomm2.RThreshold=1
End SubPrivate Sub MSComm2_OnComm()
Select Case MSComm2.CommEvent
Case comEvReceive
Dim i() As Byte
i = MSComm2.Input
Label1.Caption = StrConv(i, vbUnicode)
End Select
End SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MSComm1.Output = Text1.Text
End If
End Sub当我在text中输入8个以下英文字母时,label可以完整显示,而text中大于8个时,label只显示第8个字母以后的,这是为什吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货