[ACCEPTED]-Mousewheel Delta value always 120-mousewheel
You should be able to handle the PreviewMouseWheel event. The 3 delta for each event will be +/-120, but 2 you will get one event for each "notch" of 1 the wheel.
John Myczek gave the basically right answser. I 6 should add that if you turn the wheel fast 5 enough, you will notice that the delta is 4 lager than 120 or smaller than -120. It 3 will be a multiples of +/-120. So you'd 2 better do some division in the handle of 1 PreviewMouseWheel event.
The above statements about the value always being +/-120 are not always 5 correct.
If you rotate the wheel slowly, the value 4 is indeed +/-120, but than, if you rotate 3 the wheel fast, the value becomes +/-240.
I'm 2 guessing that there may be other values too (haven't tested 1 it, yet)...
private int step = 0;
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseMove(e);
if(e.Delta>0)
step++;
else if(e.Delta<0)
step--;
this.Text = "Step:-" + step.ToString();
}
0
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.