Get text of a rich text box RRS feed

  • Question

  • Hi,

    I would like to know how to take the text of a rich text box. I know how to do it with a normal text box (.text), but with a rich one it doesn't work. I checked some tutorials, but it was kind of weird and it was never returning a string. How do I do this?
    Friday, February 12, 2010 10:34 PM


All replies

  • Try the Windows Forms RichTextBox.
    • Proposed as answer by JohnGrove Friday, February 12, 2010 11:03 PM
    • Marked as answer by Bin-ze Zhao Thursday, February 18, 2010 8:10 AM
    Friday, February 12, 2010 10:59 PM
  • Saturday, February 13, 2010 5:12 AM
  • Sorry but I dont know what you mean that it's not work!
    According to MSDN:

    "RichTextBox.Text Property
    Gets or sets the current text in the rich text box.
    public override string Text { get; set; }
    To display multiple lines of text in a RichTextBox, set the Multiline property to true. To read or set the text of a multiline text box, use the Lines property. The Text property does not return any information about the formatting applied to the contents of the RichTextBox. To get the rich text formatting (RTF) codes, use the Rtf property. The amount of text that can be entered in the RichTextBox control is limited only by available system memory."

    So, as you see, the RichTextBox.Text returns a string as you wish.
    Can you please tell us more about your situation which doesn't work as you expect?

    Please help us improve this community forum for visitors by marking the replies as answers if they help and unmarking them if they provide no help.
    Saturday, February 13, 2010 8:50 AM