Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
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??
8/22/2022 - Mon
Sure, how about this? If by 'below' you mean as displayed (48..n) is 'below' 47
private void Form1_Load(object sender, EventArgs e)
string  lines = new string[richTextBox1.Lines.
nes, 48, lines, 0, richTextBox1.Lines.Length - 48);
richTextBox2.Lines = lines;
lines = new string;
nes, lines,48 );
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.
...I needed it to be in VB. Can that be done?
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Perfect!! That works great..
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent