Вопрос

How can i load a .txt file as FlowDocument to put it in a RichTextBox?

Это было полезно?

Другие советы

The following is a pretty simple method.

using (var fs = new FileStream(FileName, FileMode.OpenOrCreate))
{
     var range = new TextRange(Document.ContentStart, Document.ContentEnd);
     range.Load(fs, DataFormats.Text);
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top