Save/Load documents - RichtextBox

Use this board to post your code snippets - tips and tricks
2 posts Page 1 of 1
Contributors
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

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
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
CodemaN
VIP Access - Denied
VIP Access - Denied
Posts: 74
Joined: Fri Sep 18, 2009 3:18 pm

thnxxx...!!!!
2 posts Page 1 of 1
Return to “Quick Snips”