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

# TToolButton.CheckMenuDropdown

Checks for and executes a drop-down menu for the tool button.

## Declaration

Source position: comctrls.pp line 2184

`public function TToolButton.CheckMenuDropdown: Boolean; virtual;`

## Function result

True if the drop-down menu for the button was successfully displayed and executed.

## Description

CheckMenuDropdown is a Boolean function used to check whether a drop-down menu can be displayed and executed for the tool button. The menu can be represented using either the DropDownMenu property (with its AutoPopUp property set to True) or the MenuItem property.

No actions are performed in the method at design-time, when the parent tool bar has not been assigned, or when neither DropDownMenu nor MenuItem has been assigned.

When a menu is available, the flags for the tool button are updated to include the value tbfDropDownMenuShown. The CheckMenuDropdown method in the parent tool bar is called to display and execute the drop-down menu, and get the return value for the method. The return value is True if the menu was successfully display and executed by the parent tool bar. The button flags are reverted prior to exiting from the method.

CheckMenuDropdown is called from the MouseDown method when the left mouse button is clicked on a button (or its drop-down indicator).

## See also

TToolButton.DropDownMenu |  | The drop-down menu displayed when the button is pressed.
TToolButton.MenuItem |  | Contains a menu item associated with the tool button.
TToolButton.Style |  | Determines the display style for the tool button.
TToolButton.MouseDown |  | Handles mouse click events for the tool button.
TToolBar.CheckMenuDropdown |  | Determines whether the specified button has a drop-down menu item which must be checked.