Click here to Skip to main content
13,088,464 members (56,698 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i have 5 textboxes and a richtextbx of 5 line. how can i get 1st line text of richtextbox in 1st textbox, 2nd line text of richtextbox in 2nd textbox, and so on
Posted 23-Feb-13 21:18pm
arvindnitin7 26-Feb-13 23:17pm
suppose if we left myTextBoxForLineTwo blank then it shows blank space in myRichTextBox.
how to remove this blank space from myRichTextBox.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

string[] lines = myRichTextBox.Lines;
if (lines.Length >= 5)
    myTextBoxForLineOne.Text = lines[0];
    myTextBoxForLineTwo.Text = lines[1];
    myTextBoxForLineThree.Text = lines[2];
    myTextBoxForLineFour.Text = lines[3];
    myTextBoxForLineFive.Text = lines[4];

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 24 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100