I'm having an issue with the WPF WebBrowser
control. It seems to have the logical focus (at least, when I press a key, my keyUp/keyDown events are fired), but the caret is not displayed on the control.
In fact, although the keyUp events are fired, nothing is written in the webbrowser since the caret is not displayed.
Focusable
property is set to True
not only on the Usercontrol, but also on the WebBrowser control until I click on the box.
I tried setting the focus on the webBrowser:
this.webBrowser.Focus();
Keyboard.Focus(this.webBrowser);
But also on the mshtml element (webBrowser.Document)
this.webBrowser.Document.Focus();
The property Keyboard.FocusedElement
returns webBrowser
.
This post sounds very similar to my problem, and the solutions posted there are not working in my case. I'm not sure if there's any solution: WebBrowser control keyboard and focus behavior
Any hint? Thanks in advance.