c# - How to hook a mouse wheel event to a form that has a panel and a scroll bar -


I want to hook a mouse wheel event on my scroll bar, but I can not see mouse wheel events in control properties . I have a form on which I have a panel and a vertical scroll bar. So far, my scroll bar does not work with mouse wheel. I need to hook that incident to my scroll bar with how to do it ??

You must attach the event to:

For example:

  Public Partial Category Form 1: Form {Public Form 1 ()}    {InitializeComponent (); This.MouseWheel + = New MouseEventHandler (MouseWheelEvent); This.MouseMove + = New MouseEventHandler (MouseWheelEvent); } Private Zero MouseWheelEvent (Object Sender, MouseEventArgase E) {Console.Out.WriteLine (e.Delta); }}  

Comments