I have a richtextbox which I write lines of data to. However, everytime a new line is written to the richtextbox it overwrites the last line of data so therefore after the progam runs only the last line of data is displayed in the richtextbox. I need the lines to be displayed in a list but I don't know what code I can use to make sure the cursor moves to a new line before writting the data to the richtextbox.

I appreciate any help I can get with this problem.

Thanks in advance,


I think u not appending the text in Richtextbox rather u are assign a text
For Ex richText1.Text = someString; U can try richText1.Text += someString; or richText1.AppendText ( someString ); Example Code

string[] str = { "C#", "Programming", "language"};

    foreach (string s in str)
        //richTextBox1.Text += s;

Thank you for your help selvaganapathy - the code you suggested worked.

Thanks again,


This question has already been answered. Start a new discussion instead.