I'm currently reading data from a device via RS232 using the code;
UpdateTextBox2(MCport1.ReadExisting()); // Write serial data stream to textbox
where UpdateTextBox2 is;
private void UpdateTextBox4(string text)
{
if (textBox4.InvokeRequired)
{
textBox4.Invoke(new MyDelegate1(UpdateTextBox4), new object[] { text });
Application.DoEvents();
}
else
textBox4.AppendText(text);
Application.DoEvents();
}
The problem is, the data is coming back as one long string and displaying newline symbols rather than interpreting them as newlines. Please see the attached image to see what I mean.
Once I paste this code into a text editor, the rectangles are seen as /n and are treat as such. How can I get textbox4 to treat this symbols as new line characters and not as symbols?