0
我正在動態創建FlowDocumentScrollViewer如何在FlowDocumentScrollViewer中打開.txt文件? 我使用這個時,我有richtextbox,但我怎麼做在FlowDocumentScrollViewer相同?將.txt加載到FlowDocumentScrollViewer中?
fStream = new FileStream(filePath, FileMode.OpenOrCreate);
range = new TextRange(mcRTB.Document.ContentStart, mcRTB.Document.ContentEnd);
range.Load(fStream, DataFormats.Text);
你不知道。您在FlowDocumentScrollViewer中顯示一個FlowDocument。 – Paparazzi
你能幫我一個代碼片段嗎? – user2495173
沒有相同的。 FlowDocumentScrollViewer不顯示直線文本。在msdn.microsoft.com上有關於如何創建FlowDocument的示例。 – Paparazzi