DEL and BACKSPACE keys get eaten from WebBrowser

前端 未结 1 1865
误落风尘
误落风尘 2021-01-18 23:22

I have a custom task pane in a VSTO Outlook add-in which hosts a System.Windows.Forms.WebBrowser control. All works well but in web forms DEL and BACKSPACE keys

相关标签:
1条回答
  • 2021-01-19 00:22

    Disclaimer: my answer is not related to Outlook plug-in, but it may help future visitors, who may find this page using a search engine (same as I did). It is relevant to the problem described, but in a different context.

    Today is 2017, none of the answers worked (deleted, linked and others found by google search). I discovered that in my situation (embedded ActiveX control in a web page), DEL and BACKSPACE as well as other control keys (HOME, END, arrow keys) start working after I press TAB, and continues to work after that.

    I added

    obj.focus();
    

    Immediately after setting the .Url in my Javascript, and it magically solved the problem (obj is my ActiveX browser written in .NET, using WPF browser control under the hood).

    SendKeys, setting focus from within the control and intercepting keys in .NET did not help.

    0 讨论(0)
提交回复
热议问题