FocusHelper::MoveFocusInto Method (UIElement^)

 

Uses the MoveFocus method to try to move WPF focus to the first valid focusable element inside the given UIElement, after first enduring that WPF will not attempt to change focus because of a cross- HwndSource focus change.

Namespace:   Microsoft.VisualStudio.PlatformUI
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public:
static void MoveFocusInto(
	UIElement^ element
)

Parameters

element
Type: System.Windows::UIElement^

The element to move focus into.

If MoveFocus fails to move focus into the element, focus will be cleared by invoking ClearFocus to clear WPF focus and using SetFocus to focus the HWND of the HwndSource containing the element.

Return to top
Show: