The situation is this. There is an array of tb [] textboxes (there are many of them in the form, for example, starting from textBox1 to textBox36). Copy text from some text file. How to make, that on pressing of the button the text from a clipboard is interposed into each subsequent textbox, but with a small condition. Every 6 lines of the copied text should be inserted into each text box starting from the first. For example, there is text from 18 lines, lines 1 through 6 should be inserted into the first textbox, 7 through 12 through the second, 13 through 18 into the third (and so on). The problem may seem strange, but I really need it). Thank you in advance.

    1 answer 1

    This is solved as follows:

    textBoxes[i].Text = string.join("", fileLines.Skip(i).Take((i+1)*6));