Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does WPF have mouse wheel scrolling up and down event

Tags:

c#

wpf

mousewheel

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.

like image 350
dongx Avatar asked Jun 13 '14 22:06

dongx


People also ask

Which event is called when a mouse wheel scrolls?

Definition and Usage The onwheel event also occurs when the user scrolls or zooms in or out of an element by using a touchpad (like the "mouse" of a laptop).

How do I assign clicking to my scroll wheel?

Go to the normal mouse tab, add a new button, go to the "click here to select mouse button" area and scroll the wheel. It will capture that action and you may assign it to what you want.

Which feature of the mouse is useful for scrolling?

The scroll wheel that is located in the middle of the mouse is used to scroll up and down on any page without using the vertical scroll bar on the right hand side of a document or webpage. The scroll wheel can also be used as a third button on the mouse.


1 Answers

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.

like image 110
John Melville Avatar answered Oct 15 '22 13:10

John Melville