From the course: Windows Presentation Foundation: 3 Events and the Event Model

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Use the MouseWheel event

Use the MouseWheel event

From the course: Windows Presentation Foundation: 3 Events and the Event Model

Start my 1-month free trial

Use the MouseWheel event

- [Instructor] For this example application I have an image transition application. Right now we're looking at this picture of some food and a pretzel on the screen. I'll take my mouse and use the mouse wheel and eventually the pretzel picture disappears and this picture of a pastry appears. If I locate my mouse the opposite direction, we return through a transition back to the original picture. In the upper left hand corner, I have a number up here that represents the opacity level of the picture, in this case the pretzel picture. That's as useful for you and me, your users could probably care less about having an opacity value there, but it helps us see what's happening. Watch this again as I rotate my mouse wheel. When it gets to zero I know that the opacity level of the pretzel picture is zero, which means its invisible. And that means that this pastry picture is set at one. And when I move my mouse in the other direction, it goes back up to one. Since I'm using a numeric input…

Contents