locked
add words into rich text BOX RRS feed

  • Question

  • how can I add values into Rech Text BOX...
    I want to print each word line by line in Rich text BOX....

    I usually display in TextBoxs with ", "in between word to word..
    textBox.Text += word+" ,";
    Wednesday, March 17, 2010 8:06 PM

Answers

  • You can use

    richTextBox.AppendText("\n"); // add new line
    richTextBox.AppendText(word); // add word

    or 

    if (richTextBox.Text.Length > 0)
    richTextBox.AppendText("\n"); // add new line only if not the first word
    richTextBox.AppendText(word); // add word

    • Marked as answer by shot_of_fire Wednesday, March 17, 2010 8:16 PM
    Wednesday, March 17, 2010 8:11 PM