5

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 do not work. As if something eats those keys before they get to the browser.

Any pointers are appreciated.

EDIT:

It seems that clicking the WebBrowser does not activate the parent task pane. If I add a simple TextBox as a sibling to WebBrowser and then click TextBox with a mouse, task pane's title bar color changes indicating it got focus. Next if I click WebBrowser, Del and Backspace start working.

If I remove focus from task pane and get back to it by clicking WebBrowser, task pane does not receive focus (title bar remains painted with unfocused color) and the Del and Backspace problem reoccurs.

Why is task pane unaware of browser receiving focus?

wpfwannabe
  • 14,587
  • 16
  • 78
  • 129
  • Did you search StackOverflow before posting? http://stackoverflow.com/search?q=backspace+internet-explorer – EricLaw May 19 '11 at 13:32
  • Of course I did. I know you are trying to be helpful but those results are irrelevant. First result is `MFC`, second is `IE Toolbar`, etc. The problem I am having is very specific. The closest I have found is [this](http://stackoverflow.com/questions/4074858/outlook-add-in-text-box-delete-backspace-not-working). – wpfwannabe May 19 '11 at 13:44

1 Answers1

1

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.

Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151