【问题标题】:Spellcheck attribute inside webbrowser wpf C# contextmenu position changeWebbrowser wpf C# contextmenu位置更改中的拼写检查属性
【发布时间】: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


    【解决方案1】:

    我也遇到了同样的问题,进一步调查后发现这是 Windows 10 和 Internet Explorer 的问题,而不是 WebBrowser 控件本身的问题(请参阅here)。

    我尝试在 IE11 中打开 Outlook 并得到相同的行为。

    【讨论】:

    • 由于它没有提供解决方案,所以它更像是一个评论而不是一个答案。
    • 很遗憾,我还不能添加 cmets,所以这是我目前能做的最好的了。
    • 这意味着您必须等待 :-) 我们都度过了难关,别担心。
    猜你喜欢
    • 2019-10-07
    • 2011-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多