Mousewheel Delta value always 120

Theodore Zographos picture Theodore Zographos · May 7, 2009 · Viewed 9.5k times · Source

I am creating an application in WPF that uses the mousewheel to zoom in/out an image. The amount of zooming is based on the amount of mouse wheel turning.

The problem is that the Delta value is always 120, as explained in MSDN. So, even if I turn the wheel 1 notch or 5 notches it will always be 120. Do you know a way around this?

Answer

John Myczek picture John Myczek · May 7, 2009

You should be able to handle the PreviewMouseWheel event. The delta for each event will be +/-120, but you will get one event for each "notch" of the wheel.