WebView2.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This is overridden from UIElement and is called to inform us when we receive the keyboard focus. We handle this by passing the keyboard focus on to the underlying CoreWebView2. We never want to land in a state where our window (this.Handle) actually has the keyboard focus.
protected override void OnGotKeyboardFocus (System.Windows.Input.KeyboardFocusChangedEventArgs e);
override this.OnGotKeyboardFocus : System.Windows.Input.KeyboardFocusChangedEventArgs -> unit
Protected Overrides Sub OnGotKeyboardFocus (e As KeyboardFocusChangedEventArgs)
Parameters
Arguments from the underlying GotKeyboardFocus event.
Remarks
Note that it's actually possible for us to receive keyboard focus without this method being called. One known case where that happens is when our parent window is deactivated while we have focus, then reactivated. We handle that case in WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean).