【发布时间】:2014-05-13 17:52:14
【问题描述】:
我正在动态创建 FlowDocumentScrollViewer 如何在 FlowDocumentScrollViewer 中打开 .txt 文件? 我在拥有richtextbox 时使用了它,但是如何在FlowDocumentScrollViewer 中执行相同的操作?
fStream = new FileStream(filePath, FileMode.OpenOrCreate);
range = new TextRange(mcRTB.Document.ContentStart, mcRTB.Document.ContentEnd);
range.Load(fStream, DataFormats.Text);
【问题讨论】:
-
你没有。您在 FlowDocumentScrollViewer 中显示一个 FlowDocument。
-
你能帮我写一个相同的代码 sn-p 吗?
-
不一样。 FlowDocumentScrollViewer 不显示纯文本。 msdn.microsoft.com 上有关于如何创建 FlowDocument 的示例。
标签: c# wpf file load flowdocumentscrollviewer