0

Using visual studio c# I am receiving serial data and want it to always scroll to new data.

This is my method:

   private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        this.Invoke(new EventHandler(serialPort1_DataReceived));
    }

   private void serialPort1_DataReceived(object sender, EventArgs e)
    {
        string dump = serialPort1.ReadLine();
        incomingTB.Text = incomingTB.Text + dump;
    }

I have tried to use append and can't get it to scroll down. The behavior doesn't change.

fluxanode
  • 1
  • 1
  • Duplicate of https://stackoverflow.com/questions/8938775/multiline-textbox-with-automatic-vertical-scroll?rq=2 ? – Michel Keijzers May 10 '23 at 20:06
  • I tried that, must be doing something wrong – fluxanode May 10 '23 at 20:18
  • Really, can i get some help, like how to implement in my code besides a redirect to another post? I am not using XAML and really no idea what it is, i am just learning c#. – fluxanode May 10 '23 at 20:37
  • Hello, welcome to Stack Overflow - you are more likely to get help if people can find your question through the tags... if you are asking a question about C#, it's advisable to tag it with the C# tag. – Andy Preston May 12 '23 at 12:59

0 Answers0