I'm looking for a solution to read 10 lines from a text files and then more 10 lines until the end of the file.
This is what I started, of course it shows me the first 10 lines, but how can I repeat this process for the next 10 lines and so on, until the end of the file?

```
private void openFile_Click(object sender, EventArgs e)
{
    int counter = 0;
    string line;

    using (var file =
       new System.IO.StreamReader(@"C:\\Users\\LJ_TEX\\Desktop\\Book1.txt"))
    {
        while ((line = file.ReadLine()) != null)
        {
            counter++;
            if (counter <= 10)
            {
                tboxreadData.AppendText(line + '\r' + '\n');
            }
            if (counter == 10)
            {
                tboxreadData.AppendText("NEXT");
            }
        }
    }
}

```

**EDIT**

So I managed to make a little change, show one line at a click of the button with this

```
 System.IO.StreamReader file = null;

 private void openFile_Click(object sender, EventArgs e)
    {
        string line;

        if (file == null)
            file = new System.IO.StreamReader(@"C:\\Users\\LJ_TEX\\Desktop\\Book1.txt");

        if (!file.EndOfStream)
        {
            line = file.ReadLine();
            tboxreadData.AppendText(line + '\r' + '\n');
        }
        else
        {
            tboxreadData.AppendText("End");
        }

    }

```

Sure, it only shows one line line at a time. If anyone have a idea how to show more lines, 5 or 10, feel free to share.

Thanks,
Jonathan