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.

C#
protected virtual bool HasKeyboardFocusCore();

Returns

Boolean

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.

Applies to

Produk Versi
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

See also