我使用 windows 窗体控件创建了一个所见即所得编辑器作为标准 C# 程序。除了WPF,我想做同样的事情。
在我的旧应用程序中,我做了这样的事情。
using mshtml;
private IHTMLDocument2 doc;
...
HTMLeditor.DocumentText =
"<html><body></body></html>";
doc = HTMLeditor.Document.DomDocument as IHTMLDocument2;
doc.designMode = "On";
这允许在编辑器上使用 Document.ExecCommand。
这在 WPF 中是如何实现的?它看起来不像 WPF 中的 WebBrowser 控件允许设计模式。
谢谢!