If Left(strtem, 1) = "a" Then
Text2.Text = Mid(strtem, 2, 36): Text1.Text = Text1.Text + Text2.Text + vbCrLf: strph(s1) = Text2.Text: s1 = s1 + 1
End If
上面通过串口接收到数据,在text1中显示,每接收一组数据就换行
Text2.Text + vbCrLf 就是用“+ vbCrLf ” 这样就可以了
当然有一个细节十分重要:
text1控件的属性:
在设计窗口设置text1的multiline属性为true,
如果想有滚动条就
scrollbars属性为2
两者结合才能达到效果