MouseWheel Event

UIElement.MouseWheel Event

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Occurs when the user rotates the mouse wheel while the mouse pointer is over a UIElement, or the UIElement has focus.

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

public event MouseWheelEventHandler MouseWheel
<uiElement MouseWheel="eventhandler"/>s

Use a handler based on MouseWheelEventHandler to handle this event..

The MouseWheel event is a bubbling event. This means that if multiple MouseWheel event handlers are registered for a sequence of objects connected by parent-child relationships in the object tree, the event is potentially received by each object in that relationship. The bubbling metaphor indicates that the event starts at the source and works its way up the object tree. For a bubbling event, the sender available to the event handler identifies the object where the event is handled, not necessarily the object that actually received the input condition that initiated the event. To get the object that initiated the event, use the OriginalSource value of the event data.

Important noteImportant Note:

Handling mouse wheel events may require techniques beyond just handling this event, depending on your application and platform considerations..

If a UIElement has mouse capture, it can generate MouseWheel events even if the pointer has moved elsewhere.

Handling MouseWheel and marking Handled as true in the event data has potential effect on how the HTML OnMouseDown event is reported in the HTML DOM..

MouseWheel and OnMouseWheel

Controls that inherit MouseWheel can provide handling for the event that acts as handler for all instances, by overriding the OnMouseWheel method. This might include marking the Handled value of the event as true, which has the effect of suppressing further handling of the MouseWheel event on any instance of the control (and potentially any subclass of the control.

You can also register handlers such that they are invoked even for already-handled routed events. For more information, see AddHandler.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2018 Microsoft