Partager via


FocusHelper.IsKeyboardFocusWithin Method

Definition

Overloads

IsKeyboardFocusWithin(IntPtr)

Determines if Win32 keyboard focus is within an HWND.

IsKeyboardFocusWithin(UIElement)

Determines if WPF or Win32 keyboard focus is within a UIElement.

IsKeyboardFocusWithin(IntPtr)

Determines if Win32 keyboard focus is within an HWND.

public:
 static bool IsKeyboardFocusWithin(IntPtr hwnd);
public static bool IsKeyboardFocusWithin (IntPtr hwnd);
static member IsKeyboardFocusWithin : nativeint -> bool
Public Shared Function IsKeyboardFocusWithin (hwnd As IntPtr) As Boolean

Parameters

hwnd
IntPtr

nativeint

The HWND which may have focus or contain focus.

Returns

True if the HWND contains focus or is focused, otherwise false.

Applies to

IsKeyboardFocusWithin(UIElement)

Determines if WPF or Win32 keyboard focus is within a UIElement.

public:
 static bool IsKeyboardFocusWithin(System::Windows::UIElement ^ element);
public static bool IsKeyboardFocusWithin (System.Windows.UIElement element);
static member IsKeyboardFocusWithin : System.Windows.UIElement -> bool
Public Shared Function IsKeyboardFocusWithin (element As UIElement) As Boolean

Parameters

element
UIElement

The element to check.

Returns

True if WPF or Win32 keyboard focus is within the element, otherwise false. In the case of split WPF/Win32 focus,

Applies to