0

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?

Attachments squares.PNG 1.84 KB
2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by jfarrugia
0

I've worked on a couple sms apps using AT commands via com ports.. if you could give me a sample dump of whats being returned and maybe some more code i might be able to help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.