FocusManager.GetFocusedElement 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.
Overloads
GetFocusedElement() |
Retrieves the element in the UI that has focus. |
GetFocusedElement(XamlRoot) |
Retrieves the focused element within the XAML island container. |
GetFocusedElement()
Retrieves the element in the UI that has focus.
public:
static Platform::Object ^ GetFocusedElement();
/// [Windows.Foundation.Metadata.Overload("GetFocusedElement")]
static IInspectable GetFocusedElement();
[Windows.Foundation.Metadata.Overload("GetFocusedElement")]
public static object GetFocusedElement();
function getFocusedElement()
Public Shared Function GetFocusedElement () As Object
Returns
The object that has focus. Typically, this is a Control class.
- Attributes
Applies to
GetFocusedElement(XamlRoot)
Retrieves the focused element within the XAML island container.
public:
static Platform::Object ^ GetFocusedElement(XamlRoot ^ xamlRoot);
/// [Windows.Foundation.Metadata.Overload("GetFocusedElementWithRoot")]
static IInspectable GetFocusedElement(XamlRoot const& xamlRoot);
[Windows.Foundation.Metadata.Overload("GetFocusedElementWithRoot")]
public static object GetFocusedElement(XamlRoot xamlRoot);
function getFocusedElement(xamlRoot)
Public Shared Function GetFocusedElement (xamlRoot As XamlRoot) As Object
Parameters
- xamlRoot
- XamlRoot
Returns
The object that has focus. Typically, this is a Control class.
- Attributes
See also
- GetFocusedElement()
- Keyboard interactions
- Focus navigation for keyboard, gamepad, remote control, and accessibility tools
- Programmatic focus navigation