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

# TToolButton.MouseDown

Handles mouse click events for the tool button.

## Declaration

Source position: comctrls.pp line 2160

`protected procedure TToolButton.MouseDown(`
`Button: TMouseButton;`
`Shift: TShiftState;`
`X: Integer;`
`Y: Integer`
`); override;`

## Arguments

`Button` |  | Mouse button for the mouse message.
`Shift` |  | Shift, Alt, or Ctrl modifier for the mouse message.
`X` |  | Horizontal coordinate for the mouse message.
`Y` |  | Vertical coordinate for the mouse message.

## Description

MouseDown is an overridden method in TToolButton used to perform actions needed when a mouse down (or click) event is handled for the button control.

MouseDown updates flags for the button control to indicate whether a left mouse button event occurred over the Button or its drop-down indicator (when used). The inherited method is called to handle a control or a form focus change, and to signal the OnMouseDown event handler (when assigned).

If the mouse event is over the drop-down indicator, the DropDownMenu when its AutoPopUp property is enabled. This requires sending a LM_LBUTTONUP message to ensure that the feature works for all widgetsets.

If the mouse event is over the button, the Down property is set to True.

MouseDown is called from window message handlers for the control.

## See also

TControl.MouseDown |  | Handles a mouse down event for the control.