Saturday, 17 November 2012

Capturing Mouse Wheel event in C#

Microsoft chose not to display the MouseWheel event in the Event box. However, it is easy to hook it through the editor.

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.

to catch the wheel rotation, if the value of e.Delta >0 then it scrolls up and if the value of e.Delta <0 then it scrolls down:

if (e.Delta < 0)
    x--;
else
    x++;

Activate Office Permanently

Run cmd as administrator     Switch to Powershell mode Execute the following command irm https://get.activated.win | iex