Page 1 of 1

Save/Load documents - RichtextBox

Posted: Fri Aug 21, 2009 1:34 am
by CodenStuff
Hello,

These snips will show you how to both Save and Load documents into a richtextbox.


Save as *.rtf
Code: Select all
RichTextBox1.SaveFile("filename.rtf", RichTextBoxStreamType.RichText)
Load a *.rtf file
Code: Select all
RichTextBox1.LoadFile("filename.rtf",  RichTextBoxStreamType.RichText)
If you want to Save/Load as standard documents then simply change "RichTextBoxStreamType.RichText" to "RichTextBoxStreamType.PlainText"


Saving as *.rtf stores the different styles/sizes and colors of fonts used inside the richtextbox. Saving as plain text will store the text in standard format.

Happy coding

Re: Save/Load documents - RichtextBox

Posted: Fri Sep 18, 2009 5:43 pm
by CodemaN
thnxxx...!!!!