Hi, could someone please explain what this code means is some detail.
Private Sub ReceivedText(ByVal [text] As String)
'compares the ID of the creating Thread to the ID of the calling Thread
If Me.rtbReceived.InvokeRequired Then
Dim x As New SetTextCallback(AddressOf ReceivedText)
Me.Invoke(x, New Object() {(text)})
Else
Me.rtbReceived.Text &= [text]
End If
End Sub
Right now I am receiving "string characters" from a serial port and displaying them in rtbReceived (text box), however
my main goal is to somehow convert this function to read the string and convert the data into hex format before it displays
in rtbReceived.
Is it correct to try to do this in this function, or should it be done in SerialPort1_DataReceived?
Any help would be greatly appreciated.
Thank you.
Private Sub ReceivedText(ByVal [text] As String)
'compares the ID of the creating Thread to the ID of the calling Thread
If Me.rtbReceived.InvokeRequired Then
Dim x As New SetTextCallback(AddressOf ReceivedText)
Me.Invoke(x, New Object() {(text)})
Else
Me.rtbReceived.Text &= [text]
End If
End Sub
Right now I am receiving "string characters" from a serial port and displaying them in rtbReceived (text box), however
my main goal is to somehow convert this function to read the string and convert the data into hex format before it displays
in rtbReceived.
Is it correct to try to do this in this function, or should it be done in SerialPort1_DataReceived?
Any help would be greatly appreciated.
Thank you.