loading data into each textbox line by line

Posted by Kyle on Stack Overflow See other posts from Stack Overflow or by Kyle
Published on 2011-02-27T07:12:56Z Indexed on 2011/02/27 7:24 UTC
Read the original article Hit count: 135

Filed under:
private void sessionText()
        {
            try
            {
                System.IO.TextReader r = new System.IO.StreamReader("saved.txt");
                this.textBox1.Text = r.ReadLine();
                r.Close();
            }
            catch (Exception x)
            {
                MessageBox.Show("Exception " +x);
            }
        }

It reads the line into textBox1 but now I'm expanding my application. I added 5 more textBoxes and now I'm trying to load the data in each one saved line by line. How can I load each line into the next textbox?

Line 0 -> textBox1
Line 1 -> textBox2
Line 2 -> textBox3

© Stack Overflow or respective owner

Related posts about c#