UIElement.LostFocus event

Expand
This topic has not yet been rated - Rate this topic

UIElement.LostFocus event

[This documentation is preliminary and is subject to change.]

Occurs when a UIElement loses focus.

Syntax


public event RoutedEventHandler LostFocus


<uiElement LostFocus="eventhandler"/>

Event information

Delegate RoutedEventHandler

Remarks

The typical reason that a control loses focus is that another control now has focus. But there are other possible reasons for losing focus, such as switching to another view state or another app, or the user interacting with the system in other ways.

This event is a routed event. For more info on the routed event concept, see Events and routed events overview.

Specific Windows Runtime controls may have class-based handling for the LostFocus event. If so, the control probably has an override for the method OnLostFocus. Typically the event is marked handled by the class handler, and the LostFocus event is not raised for handling by any user code handlers on that control. Controls might handle the event in order to unload a visual state that displayed a focus rectangle in response to OnGotFocus. A focus rectangle is an important visual component of a control for accessibility purposes, so that users can see where the current focused element is in the UI and where the user is within the tab sequence of the overall app UI. For more info on how class-based handling for events works, see Input event handlers in controls. For more info on tab sequences and accessibility, see Implementing keyboard accessibility.

Requirements

Minimum supported client

Windows 8 Release Preview

Minimum supported server

Windows Server 2012

Namespace

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

Metadata

Windows.winmd

See also

UIElement
GotFocus
Responding to keyboard input
Control.Focus

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD