[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Grids' (#lcl)

# TCustomGrid.DoMouseWheel

Handles a mouse wheel operation for the grid control.

## Declaration

Source position: grids.pas line 1036

`protected function TCustomGrid.DoMouseWheel(`
`Shift: TShiftState;`
`WheelDelta: Integer;`
`MousePos: TPoint`
`):Boolean; override;`

## Arguments

`Shift` |  | Shift, Alt, Ctrl modifier for the mouse wheel action.
`WheelDelta` |  | Number of units the mouse wheel was moved. A negative values implies movement in the down direction.
`MousePos` |  | TPoint instance with the coordinates for the mouse pointer.

## Function result

True when the mouse wheel action was handled for the control. False when a handler was not found or the delta value was invalid.

## Description

DoMouseWheel is an overridden method in TCustomGrid used to apply a mouse wheel operation to the control. It ensures that the SelectActive property is reset to False when MouseWheelOption applies to the selection cursor instead of the visible area for the grid control.

DoMouseWheel calls the inherited method to signal the OnMouseWheel event handler (when assigned), and to apply the mouse wheel movement using the parameter values. The inherited method also determines the return value. It is False if an OnMouseWheel is not found or the message cannot handle the WheelDelta value using DoMouseWheelUp or DoMouseWheelDown.

DoMouseWheel is called from the inherited WMMouseWheel method when the LM_MOUSEWHEEL message is handled for the control.