我写了一个程序但不好用
Private Sub Form_Load()
MSComm1.CommPort = "1" '使用COM1
MSComm1.Settings = "9600,N,8,1" '波特率9600,无偶校验,8个数据位,1个停止位"
MSComm1.InBufferSize = 40 '设置MyComm接收缓冲区为40个字节
MSComm1.OutBufferSize = 6 '设置MyComm发送缓冲区为2个字节
MSComm1.InputMode = 1 '设置接收数据模式为字符模式
MSComm1.InputLen = 1 '设置一次从接收缓冲区读取字节数为1
MSComm1.SThreshold = 1 '设置一次从发送缓冲区读取字节数为1
MSComm1.RThreshold = 1 '每一个字节到接收缓冲区都触发接收事件
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
Dim top As Long '1320
Dim left As Long '360
If Command1.Caption = "停止" Then
Dim eastdot As String
eastdot = MSComm1.Input
eastdot = eastdot
Print eastdot
Shape1.top = 1680
Shape1.left = 840
End If
End Sub
请高手指点