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.
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.
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.
For event related to mouse wheel, there is only one option
No, there are others.
There is also the PreviewMouseWheel
(which functions just like the MouseWheel
event but is operates at a different point in the keyboard and mouse handling.).
The Preview also has a Delta
property which gives the direction of the wheel spin.
Example
private void PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta > 0)
DoActionUp();
else if (e.Delta < 0)
DoActionDown();
}
Preview...
has worked for me in as much as doing a peek
on a stack or a queue. –
Dufrene © 2022 - 2024 — McMap. All rights reserved.