System.Windows.Forms.ScrollableControl.OnMouseWheel Method

Raises the Control.MouseWheel event.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected override void OnMouseWheel (MouseEventArgs e)

Parameters

e
A System.Windows.Forms.MouseEventArgs that contains the event data.

Remarks

If the vertical scroll bar is visible, which means that the ScrollableControl.VScroll property is set to true, the mouse wheel scrolls through the System.Windows.Forms.ScrollableControl control vertically. However, if only the horizontal scroll bar is visible, which means that the ScrollableControl.VScroll is set to false and the ScrollableControl.HScroll property to set to true, the mouse wheel scrolls horizontally.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The ScrollableControl.OnMouseWheel(MouseEventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0