【发布时间】:2018-01-11 21:28:05
【问题描述】:
我在窗口弹出窗口中有一个 wpf webbrowser 控件,需要编辑其中的 html 元素。我使用以下代码设置它的属性,我希望拼写检查在网络浏览器中工作。
doc = webBrowser.Document as HTMLDocument;
doc.designMode = "On";
WebEditorBehavior.SetHtml(Gui.webEditorGlobal, Gui.getHTML());
if (doc != null && doc.body != null)
{
doc.body.setAttribute("width", Width.ToString() + "px");
doc.body.setAttribute("contenteditable", "true");
doc.body.setAttribute("spellcheck", "true");
//doc.body.setAttribute("s");
}
现在,当我看到拼写错误时,右键单击 Internet Explorer 菜单可以工作,但位置与 WebBrowser 无关,而是相对于整个屏幕。 但是简单的右键单击是相对于鼠标位置的,并且工作正常。这是一种奇怪的行为。任何想法或帮助将不胜感激。 干杯! 屏幕截图如下 enter image description here
【问题讨论】:
标签: c# wpf dom contextmenu spell-checking