Saturday, February 16, 2008

Capturing Mouse Wheel event in C#

Not sure why, but MS chose not to display the MouseWheel event in the Event box. However, it is quite easy to hook it through the editor.

Assuming you're using Visual Studio 2005 or 2008, it's an one step process, really -

1. In the constructor of the Form / custom control, type - "MouseWheel+=", and press TAB twice. Once for completing the statement, and again to insert the handler in the class.

It's that easy! Told you, it's one step process.

7 comments:

  1. sorry I'm not comment about what you post - I need your help - May I have your uvmodeller's source code ? please send to my email gryfindor_hu22188@yahoo.co.id

    I've sent 3 email to your hirak_99@myrealbox.com but failed. so I hope you see this comment and can help me. I'm so apreciated it.

    ReplyDelete
  2. You can download UVModeller source code from Google Code project here:
    http://code.google.com/p/uvmodeller/source/checkout

    ReplyDelete
  3. it's really coooooool.
    but how can i count how many times it is wheeled to forward and backward?

    ReplyDelete
  4. Thanx!!! This did it:

    1. In the constructor of the Form / custom control, type - "MouseWheel+=", and press TAB twice. Once for completing the statement, and again to insert the handler in the class.

    Example:

    MouseWheel += new MouseEventHandler(Form2_MouseWheel);

    void Form2_MouseWheel(object sender, MouseEventArgs e)
    {
    //throw new NotImplementedException();
    if (e.Delta > 0)
    {
    index--;
    else
    {
    index++;
    }
    }

    ReplyDelete
  5. I was trying to setup my Netgear Ex2700 Extender several times after factory resets. Each time the "genie" pops up and I go through the steps to connect to my WiFi and it assignes the _EXT name to it then it reboots. I can then connect to the new _EXT Wifi name but there is no Internet connection and I cannot access the mywifiext.net netgear setup page.

    ReplyDelete
  6. I bought the new extender for Mywifiext Net Netgear Setup and can no longer access the connection. it says my password was changed but i never changed it. either way, how do i reset it or fix it?

    ReplyDelete
  7. My netgear wifi extender suddenly won't pick up the connection of the new router! I'm sure there's something I'm doing wrong but what? None of the devices in the house will connect to the extender. Have you any idea how to netgear new extender setup

    ReplyDelete