Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Comments
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

Try:
C#
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];
    }
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900