Well guys I was thinking of a short when I said 32k max lol...
Well the rtbox.Lines array is only read only, so I'm afraid the copy won't work. I'm looking for other methods of getting only the contents I need from one rtbox to another using builtin functions if at all possible. While I could do a loop this would be unacceptable as the amount of data could be large.
Ok everyone, the answers been in the function I was trying to use. Just not going about it the correct way. Heres what appears to be a working solution:
Dim lines(CInt(TextBox2.Text)) As String
Array.ConstrainedCopy(RichTextBox1.Lines, CInt(TextBox1.Text), lines, 0, CInt(TextBox2.Text))
RichTextBox2.Lines = lines
I'd translate it to C# but it should pretty much be the same. Don't know if C# gives you access to Array.ConstrainedCopy. Whats going on? Well this is just a test project. I got two RichTextBoxes and the object was to copy from line x (TextBox1) y (TextBox2) number of lines to RichTextBox B from RichTextBox A. I tried taking advantage of ReDim Preserve functionality in VB orginally, but that didnt work so declaring the lines array to store the end result with the correct size off the bat is a must. No pretty one liners but its working.
Here's what a C# version might look like to satisify the forum this topic was posted in:
Array.ConstrainedCopy(RichTextBox1.Lines, (int)TextBox1.Text, lines, 0, (int)TextBox2.Text);
RichTextBox2.Lines = lines;
Last edited by kairozamorro; 08-28-2009 at 06:54 PM. Reason: Included C# code
Ok, implemented into the actual program now and its working. Thanks to everyone who helped