Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived ReceivedText(SerialPort1.ReadExisting()) End Sub Private Sub ReceivedText(ByVal text As String) If Me.RichTextBox1.InvokeRequired Then Dim x As New SetTextCallback(AddressOf ReceivedText) Me.Invoke(x, New Object() {(text)}) Else Me.RichTextBox1.Text &= text Me.Label1.Text &= text If RichTextBox1.Text = "OK" Then OK_rs = 1 RichTextBox1.Text = "" End If End If End Sub Delegate Sub SetTextCallback(ByVal text As String)
Do If OK_rs = 1 Then Exit Do Loop OK_rs = 0
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)