当我使用一次保存文本后,再次打开HTML编辑器(WebBrowser(时,它包含旧的书面内容。如何清洁内容?
我尝试设置文档内容(例如我加载数据库的条目时(为HTMLEditor.Document.Write("");
,但它不起作用。
所以我正在加载包含WebControl作为FraferEditor viewer = new FrameEditor();
的表单,但无济于事。
我尝试使用 set _doc = null;
_doc是ihtmldocument2和 _doc = modernHTMLEditor.Document.DomDocument as IHTMLDocument2;
我试图将HTMLEDITOR重新加载为HTMLEditor = new WebBrowser();
private IHTMLDocument2 _doc;
private void viewer_Load(object sender, EventArgs e)
{
_doc = null;
modernHTMLEditor.DocumentText = "<html><body></body></html>";
_doc =
modernHTMLEditor.Document.DomDocument as IHTMLDocument2;
modernHTMLEditor.Document.Write(DocText);
_doc.designMode = "On";
modernHTMLEditor.Document.ExecCommand("FontName", false, "Arial");
FontSizeSetup();
FontTypeSetup();
}
我找到了答案。这是: _doc.open("(;在声明designMode =" on";