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

# TCustomUpDown.AssociateMouseWheel

Implements an OnMouseWheel event handler assigned to the Associate control in the class instance.

## Declaration

Source position: comctrls.pp line 1972

`protected procedure TCustomUpDown.AssociateMouseWheel(`
`Sender: TObject;`
`Shift: TShiftState;`
`WheelDelta: Integer;`
`MousePos: TPoint;`
`var Handled: Boolean`
`);`

## Arguments

`Sender` |  | Control (Associate) generating the event notification.
`Shift` |  | Shift, Ctrl, or Alt modifier for the mouse wheel event.
`WheelDelta` |  | Units of movement and direction for the mouse wheel event.
`MousePos` |  | Coordinates for the mouse pointer when the mouse wheel event was detected.
`Handled` |  | Returns True if the mouse wheel event was handled in the routine.

## Description

AssociateMouseWheel is assigned as an OnMouseWheel handler routine for the control in the Associate property. It ensures that a mouse wheel event in Associate is applied to the Up/Down control by calling its AdjustPos method.

WheelDelta indicates the direction the mouse wheel was scrolled. A positive non-zero value indicates the mouse wheel was scrolled upwards. A negative non-zero value indicates the mouse wheel was scrolled downwards.

AdjustPos is called to apply the change to the control by incrementing or decrementing the value in Position as needed. The Handled argument is set to True if the wheel event was applied to the control.

No actions are performed in the method when WheelDelta contains 0. Handled is set to False in this situation.

AssociateMouseWheel is assigned when a control is assigned to the Associate property.

## See also

TCustomUpDown.AdjustPos |  | Applies changes to the control value using its increment and decrement buttons.
TCustomUpDown.Associate |  | Control used to display and edit the Position for the control.
TCustomUpDown.Increment |  | The amount by which Position is increased or decreased for each button click.
TCustomUpDown.Max |  | The largest value allowed in the Position property.
TCustomUpDown.Min |  | The smallest value allowed in the Position property.
TCustomUpDown.Position |  | The current position (or value) for the control as a SmallInt type.
TCustomUpDown.Wrap |  | Enables or disables wrap-around for the value in Position when it exceeds the limits in Min or Max.