How to allow moving focus to and from the WPF WebView control using the Tab key in C# and VB
If you've ever used the WPF Microsoft Edge Legacy based WebView control (not to be confused with the Internet Explorer based WebBrowser control), you may have noticed that you can't use the Tab key to move focus to and from the said control and that only the mouse allows moving focus to and from it. You may also have noticed that using the WebView.Focus() method does not work. Luckily, the WebView contains both a function you can use to move focus to the WebView and an event which fires when the user attempts to move focus away from the WebView using the Tab key. How to move focus to the WebView using the Tab key We can moved focus to the WebView using the MoveFocus function of the WebView. In order to detect when the user attempts to focus the WebView, we can use a dummy button to detect the focus and then move it onto the WebView. XAML: < Button x : Name ="webViewFocusButton" Height ="0" Width ="0" Opacity ="0" GotFocus ="we...