Windows Dev Center

FocusState enumeration

Describes how an element obtained focus.

Syntax


public enum class FocusState

Members

The FocusState enumeration has these members.

MemberValueDescription
Unfocused0

Element is not currently focused.

Pointer1

Element obtained focus through a pointer action.

Keyboard2

Element obtained focus through a keyboard action, such as tab sequence traversal.

Programmatic3

Element obtained focus through a deliberate call to Focus or a related API.

Remarks

FocusState is used as a value by the Control.FocusState property. It's also used as an input by the Control.Focus method.

If used as an input parameter for Control.Focus, you can't use Unfocused. Which value of FocusState to pass to a Control.Focus call depends on the input scenario and which user interaction your control or app code is responding to. For more info, see Remarks in Control.Focus.

The exact meaning of the FocusState values depends on whether you're reading it from Control.FocusState, or using a value to send to Control.Focus. If you are setting Control.Focus you're informing other callers (like the control templates) about how that control obtained focus.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml
Windows::UI::Xaml [C++]

Metadata

Windows.winmd

Attributes

[Version(0x06020000)]
[WebHostHidden()]

See also

Control.FocusState
Control.Focus
Responding to keyboard input

 

 

Show:
© 2015 Microsoft