AutomationPeer.HasKeyboardFocusCore AutomationPeer.HasKeyboardFocusCore AutomationPeer.HasKeyboardFocusCore AutomationPeer.HasKeyboardFocusCore Method

Definition

Provides the peer's behavior when a Microsoft UI Automation client calls HasKeyboardFocus or an equivalent Microsoft UI Automation client API.

protected : virtual Platform::Boolean HasKeyboardFocusCore()
virtual bool HasKeyboardFocusCore() const;
protected virtual bool HasKeyboardFocusCore()
Protected Overridable Function HasKeyboardFocusCore() As bool

Returns

bool bool

true if the element has keyboard focus; otherwise, false.

Remarks

The standard implementation at the AutomationPeer level checks whether the owner has focus, and always returns false if the owner isn't focusable. FrameworkElementAutomationPeer expands this behavior somewhat because it adds awareness of owner characteristics that rely on the owner being a Control subclass. Test the existing return value in the peer that you are using or overriding and then override that behavior if necessary.

See also