H-SC
asked on
Display everything below a certain line in RichTextBox1 In RichTextBox2
I have a form that has 2 RichTextBoxes on it. I would like everything below line 47 in RTB1 to be diaplayed in RTB2. Can this be done??
ASKER
ororiole,
...I needed it to be in VB. Can that be done?
...I needed it to be in VB. Can that be done?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ororiole,
Perfect!! That works great..
Perfect!! That works great..
private void Form1_Load(object sender, EventArgs e)
{
string [] lines = new string[richTextBox1.Lines.
if (richTextBox1.Lines.Length
{
Array.Copy(richTextBox1.Li
richTextBox2.Lines = lines;
lines = new string[48];
Array.Copy(richTextBox1.Li
richTextBox1.Lines = lines;
}
}
If you mean below is lines 0-46 then just change the logic to get the lines <47. OR, just swap the two arrays after running this code.