EN
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

UIElement.MouseEnter Event

July 28, 2014

Occurs when a screen tap occurs within the bounding area of a UIElement.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

'Declaración
Public Event MouseEnter As MouseEventHandler
<uiElement MouseEnter="eventhandler"/>

The MouseEnter event is raised in response to a touch gesture occurring inside the object's bounding area. The MouseEnter event precedes the MouseMove event for the object.

Use a handler based on MouseEventHandler to handle this event. For more information on how to handle touch events, see Quickstart: Touch input for Windows Phone 8.

You can define multiple MouseEnter events for objects in XAML content. However, if a child object and its parent object both define a MouseEnter event, the parent object's MouseEnter event occurs before the child object's MouseEnter event. This is not a case of a bubbling event; it indicates only that a touch event has occurred for both objects, potentially at different times depending on the layout and the composition of the visual tree.

The touch position that is reported in the event data may not be exactly on the boundary of the object because of the coalescing of touch movements.

MouseEnter events do not route, they can only be handled on the element that raises them.

MouseEnter and OnMouseEnter

Controls that inherit MouseEnter can provide handling for the event that acts as handler for all instances, by overriding the OnMouseEnter method. OnMouseEnter can be useful either for setting visual state, or for public or internal state properties. For instance, Slider implements OnMouseEnter in order to check the Thumb element's value for IsDragging (which invokes a particular behavior mode), and also to set visual state. For more information, see OnMouseEnter.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Mostrar:
© 2014 Microsoft