RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TToolButton.MouseDown Method

Responds when the user clicks the button with the mouse.

Pascal
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X: Integer; Y: Integer); override;
C++
virtual __fastcall MouseDown(TMouseButton Button, TShiftState Shift, int X, int Y);

Do not call MouseDown. It is called automatically when the user clicks the tool button with the mouse. As implemented in TToolButton, MouseDown first toggles the Down property if the button's style is tbsDropDown and the user clicked the left mouse button. Then it generates an OnMouseDown event. 

The Button parameter determines which mouse button the user pressed. Shift indicates which shift keys (Shift, Ctrl, or Alt) were down when the user pressed the mouse button. X and Y are the pixel coordinates of the mouse pointer within the client area of the control. 

MouseDown helps ensure that the tool button's behavior remains unchanged, regardless of the version of ComCtl32.dll that is installed on the users system. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!