Does WPF have mouse wheel scrolling up and down event

dongx picture dongx · Jun 14, 2014 · Viewed 16.9k times · Source

I checked msdn. For event related to mouse wheel, there is only one option -- UIElement.MouseWheel

What I want to do is listening to mouse wheel scrolling forward(up) and backward(down) event.

Note: Not clicking the middle wheel button.

Answer

John Melville picture John Melville · Jun 14, 2014

No, there is just one event. When you look at the MouseWheelEventArgs class there is a property Delta. Delta is positive when the wheel is rotated away from the user and negative when the wheel is rotated toward the user.