Save/Load documents - RichtextBox
Posted: Fri Aug 21, 2009 1:34 am
Hello,
These snips will show you how to both Save and Load documents into a richtextbox.
Save as *.rtf
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
These snips will show you how to both Save and Load documents into a richtextbox.
Save as *.rtf
Code: Select all
Load a *.rtf fileRichTextBox1.SaveFile("filename.rtf", RichTextBoxStreamType.RichText)
Code: Select all
If you want to Save/Load as standard documents then simply change "RichTextBoxStreamType.RichText" to "RichTextBoxStreamType.PlainText"RichTextBox1.LoadFile("filename.rtf", RichTextBoxStreamType.RichText)
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