3

I have a Window.Form that has a WebBrowser control on it. How do you enable the control to process special keys like the Tab key for navigating between controls?

I've seen answers for doing this in activeX and mfc controls but not for the .NET control.

Thanks

RJay75
  • 133
  • 1
  • 5
  • If someone else is looking for a solution, that helped in my case: [DEL and BACKSPACE keys get eaten from WebBrowser](https://stackoverflow.com/a/44246006/6267940) – STARSCrazy Oct 15 '19 at 13:37

1 Answers1

2

The Windows.Forms WebBrowser control is a wrapper on the activex control. You have the property WebBrowserShortcutsEnabled (MSDN Link), however, that should be true by default.

Jcl
  • 27,696
  • 5
  • 61
  • 92
  • I have that enabled. It seems to have no effect on it. – RJay75 May 03 '12 at 16:42
  • Must be something else... I just tested it on a WinForms application I've made, and, at least Tab, and Ctrl-C/Ctrl-V work correctly. Are you maybe previewing the keys on the form where the control is on and cancelling the events? Or maybe the web control is contained on other control which is cancelling the bubbling? – Jcl May 03 '12 at 17:35
  • Flag this as the answer because it is what enables it. My problem turned out to be I showed the dialog container with the control then afterward navigated the control to a page. Showing it after initiating the navigation worked. – RJay75 May 03 '12 at 18:04
  • Also the form is a child of another application. So the shortcuts only work if the form is opened as a modal form. The parent application must be consuming the events before the plugin form can receive them. – RJay75 May 03 '12 at 18:21
  • working, thanks. I was about to blame Vuejs. I wonder how Del key is considered a shortcut! – Ivan Ferrer Villa Mar 22 '17 at 15:56