Hello, I have problem in one of my program,it's almost a copycat of MS-World, that means it's using RichTextBox, I have Bold,Italic,Underline etc. buttons but when I save the file and open it, it's a basic text that you can get from Notepad.
File Type: DTX
Save Method: Writer (User-made save prompt)
string GetContentAsRTF(RichTextBox rtb)
var range = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
using (var stream = new MemoryStream())
using (var reader = new StreamReader(stream))
stream.Position = 0;
Please post the code you are using to load and save the text. The usual way to load and save rich text is as follows:
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
Private Sub btnLoad_Click(sender As System.Object, e As System.EventArgs) Handles btnLoad.Click
by Reverend Jim
Thank you so much, Reverend Jim, I didn't know that RichTextBox has .Save and .Load features :-)
If you still need the code I was using...
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
(I was using objWriter to write the text from the richtextbox)