FocusManager.TryMoveFocus FocusManager.TryMoveFocus FocusManager.TryMoveFocus FocusManager.TryMoveFocus Method

Definition

Overloads

TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection)

Attempts to change focus from the element with focus to the next focusable element in the specified direction.

TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions)

Attempts to change focus from the element with focus to the next focusable element in both the specified direction and using the specified navigation options.

TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection) TryMoveFocus(FocusNavigationDirection)

Attempts to change focus from the element with focus to the next focusable element in the specified direction.

public : static Platform::Boolean TryMoveFocus(FocusNavigationDirection focusNavigationDirection)
static bool TryMoveFocus(FocusNavigationDirection focusNavigationDirection) const;
public static bool TryMoveFocus(FocusNavigationDirection focusNavigationDirection)
Public Shared Function TryMoveFocus(focusNavigationDirection As FocusNavigationDirection) As bool
Parameters
focusNavigationDirection
FocusNavigationDirection FocusNavigationDirection

The direction to traverse (in tab order).

Returns
bool bool

true if focus moved; otherwise, false.

Remarks

The tab order is the order in which a user moves from one control to another by pressing the Tab key (forward) or Shift+Tab (backward).

This method uses tab order sequence and behavior to traverse all focusable elements in the UI.

If the focus is on the first element in the tab order and FocusNavigationDirection.Previous is specified, focus moves to the last element.

If the focus is on the last element in the tab order and FocusNavigationDirection.Next is specified, focus moves to the first element.

TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions) TryMoveFocus(FocusNavigationDirection, FindNextElementOptions)

Attempts to change focus from the element with focus to the next focusable element in both the specified direction and using the specified navigation options.

public : static Platform::Boolean TryMoveFocus(FocusNavigationDirection focusNavigationDirection, FindNextElementOptions focusNavigationOptions)
static bool TryMoveFocus(FocusNavigationDirection focusNavigationDirection, FindNextElementOptions focusNavigationOptions) const;
public static bool TryMoveFocus(FocusNavigationDirection focusNavigationDirection, FindNextElementOptions focusNavigationOptions)
Public Shared Function TryMoveFocus(focusNavigationDirection As FocusNavigationDirection, focusNavigationOptions As FindNextElementOptions) As bool
Parameters
focusNavigationDirection
FocusNavigationDirection FocusNavigationDirection

The direction to traverse (in tab order).

focusNavigationOptions
FindNextElementOptions FindNextElementOptions

The options to help identify the next element to receive focus with keyboard/controller/remote navigation.

Returns
bool bool

true if focus moved; otherwise, false.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

The tab order is the order in which a user moves from one control to another by pressing the Tab key (forward) or Shift+Tab (backward).

This method uses tab order sequence and behavior to traverse all focusable elements in the UI.

If the focus is on the first element in the tab order and FocusNavigationDirection.Previous is specified, focus moves to the last element.

If the focus is on the last element in the tab order and FocusNavigationDirection.Next is specified, focus moves to the first element.

See Also
M:Windows.UI.Xaml.Input.FocusManager.TryMoveFocus(Windows.UI.Xaml.Input.FocusNavigationDirection) -