Delen via


FocusManager.FindNextFocusableElement Method

Definition

Overloads

FindNextFocusableElement(FocusNavigationDirection)

Retrieves the element that should receive focus based on the specified navigation direction.

FindNextFocusableElement(FocusNavigationDirection, Rect)

Retrieves the element that should receive focus based on the specified navigation direction and hint rectangle.

FindNextFocusableElement(FocusNavigationDirection)

Retrieves the element that should receive focus based on the specified navigation direction.

public:
 static UIElement ^ FindNextFocusableElement(FocusNavigationDirection focusNavigationDirection);
/// [Windows.Foundation.Metadata.Overload("FindNextFocusableElement")]
 static UIElement FindNextFocusableElement(FocusNavigationDirection const& focusNavigationDirection);
[Windows.Foundation.Metadata.Overload("FindNextFocusableElement")]
public static UIElement FindNextFocusableElement(FocusNavigationDirection focusNavigationDirection);
function findNextFocusableElement(focusNavigationDirection)
Public Shared Function FindNextFocusableElement (focusNavigationDirection As FocusNavigationDirection) As UIElement

Parameters

focusNavigationDirection
FocusNavigationDirection

The direction that focus moves from element to element within the application UI.

Returns

null if focus cannot be set in the specified direction.

Attributes

Remarks

You can also use either the FindNextElement(FocusNavigationDirection, FindNextElementOptions) method or the FindNextElement(FocusNavigationDirection) method to programmatically move focus. These methods retrieve the element (as a DependencyObject) that will receive focus based on the specified navigation direction (directional navigation only, cannot be used to emulate tab navigation).

Note

We recommend using the FindNextElement method instead of FindNextFocusableElement because FindNextFocusableElement retrieves a UIElement, which returns null if the next focusable element is not a UIElement (such as a Hyperlink object).

See also

Applies to

FindNextFocusableElement(FocusNavigationDirection, Rect)

Retrieves the element that should receive focus based on the specified navigation direction and hint rectangle.

public:
 static UIElement ^ FindNextFocusableElement(FocusNavigationDirection focusNavigationDirection, Rect hintRect);
/// [Windows.Foundation.Metadata.Overload("FindNextFocusableElementWithHint")]
 static UIElement FindNextFocusableElement(FocusNavigationDirection const& focusNavigationDirection, Rect const& hintRect);
[Windows.Foundation.Metadata.Overload("FindNextFocusableElementWithHint")]
public static UIElement FindNextFocusableElement(FocusNavigationDirection focusNavigationDirection, Rect hintRect);
function findNextFocusableElement(focusNavigationDirection, hintRect)
Public Shared Function FindNextFocusableElement (focusNavigationDirection As FocusNavigationDirection, hintRect As Rect) As UIElement

Parameters

focusNavigationDirection
FocusNavigationDirection

The direction that focus moves from element to element within the app UI.

hintRect
Rect

A bounding rectangle used to influence which element is most likely to be considered the next to receive focus. Examples where this can be useful include:

  • When no element currently has focus, specifying a small rectangle at a screen location of (-1, -1) starts focus from the upper left corner of the display.
  • In a program guide where you want to ensure programs at the current time receive focus. (The focus algorithm might favor shows at a later time based on a number of factors.)

Returns

null if focus cannot be set in the specified direction.

Attributes

Remarks

You can also use either the FindNextElement(FocusNavigationDirection, FindNextElementOptions) method or the FindNextElement(FocusNavigationDirection) method to programmatically move focus. These methods retrieve the element (as a DependencyObject) that will receive focus based on the specified navigation direction (directional navigation only, cannot be used to emulate tab navigation).

Note

We recommend using the FindNextElement method instead of FindNextFocusableElement because FindNextFocusableElement retrieves a UIElement, which returns null if the next focusable element is not a UIElement (such as a Hyperlink object).

See also

Applies to