Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

MouseWheel event handler

$
0
0

I'm trying to capture the value of Delta when i spin the mouse wheel. For this I created the simplest possible Windows Forms application in Visual C# 2010 Express. The relevant snippets of code are shown below. My application runs, but the execution never reaches my event handler (MouseWheelChange). What am I doing wrong?

Thanks for your help!

Mike

 In Form1.Designer.cs:

   Private void InitializeComponent()

   {

    // ....

    this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.MouseWeelChange);

    }

In Form1.cs:

    Private void MouseWheelChange(object sender, MouseEventArgs e)

    {

    int step = e.Delta;

    }


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>