FocusState enumeration

Applies to Windows and Windows Phone

Describes how an element obtained focus.

Syntax


public enum class FocusState

Attributes

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

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

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

See also

Control.FocusState
Control.Focus
Responding to keyboard input

 

 

Show:
© 2014 Microsoft