【发布时间】:2015-06-09 03:17:30
【问题描述】:
我已经能够将 .docx 文件加载到我的 wpf 应用程序中,但它似乎没有显示在我的 Richtextbox 中:
if (openFile.ShowDialog() == true)
{
// Open document
string originalfilename = System.IO.Path.GetFullPath(openFile.FileName);
if (openFile.CheckFileExists)
{
var document = DocX.Load(originalfilename);
string contents = document.Text;
rtfMain.Document = contents;
MessageBox.Show("file loaded");
}
}
wpf 中的富文本框不接受内容字符串变量。知道如何使它工作吗?
【问题讨论】:
标签: c# wpf text ms-word richtextbox