Rich Text Box

  • Thread starter Thread starter Karuppasamy
  • Start date Start date
K

Karuppasamy

Hi..

I am having a Rich Text Control in a Form.
Whatever Text entered into the RichText, i want to save the Text along with
Format.
I want to display the Text again with same format using the saved Text and
Format.

How to do that??

Thanks and Regards
Karuppasamy Natarajan
 
Hi,

you can use the methode SaveFile(string fileName) of the RichTextBox control
to store your text in RTF-format (where the text format is preserved) and
load it with LoadFile(string fileName).

An alternative way would be to get/set the Rtf-Property. It contains a
string representing your text and formattings.

Hope it helps,

Neno Loje
Microsoft Student Partner
University of Hamburg
 
In the future, please don't crosspost to so many groups.

You have two options. If you just want to store the formatted text in a
variable, use the RichTextBox.Rtf property. That properrty gets or sets a
string that contains the text itself, plus the formatting codes. (It looks
similar to HTML.)

If you want to save the formatted text to a file, use the SaveFile and
LoadFile methods.

Hope this helps,
Robert Jacobson
 
Back
Top