In the VB6.0 era, VB does not support mouse scroll wheel embedded yet. You need to use APIs to send the wm_mousewheel message of the mouse to the control to respond to rolling events. This is usually troublesome, andCodeIt is not easy to control.
Today, I studied in. NET and found that the. Net Control itself supports the mousewheel event. However, there is another problem. Since the mouse scroll wheel event can be responded by default, it is troublesome if I want to disable it, that is, the control does not respond to the scroll wheel. The difference is msdn. In fact, Microsoft has designed a class of handledmouseeventargs, which is defined as follows:
Public class handledmouseeventargs
Inherits system. Windows. Forms. mouseeventargs
Member: system. Windows. Forms
Abstract:
Allow custom controls to prevent system. Windows. Forms. Control. mousewheel events from being sent to its parent container.
This class inherits from mouseeventargs, that is, I can assign the parameter E of the mouse event response to it, and then there is an object of this class to disable the event handle. The sample code is as follows:
Private sub form=mousewheel (_
Byval sender as object ,_
Byval e as system. Windows. Forms. mouseeventargs )_
Handles me. mousewheel
Dim WM as handledmouseeventargs = E
WM. Handled = true
End sub