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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.