Mick
Mick

Reputation: 13495

Why doesn't clicking on my TToolButton show the DropdownMenu?

enter image description here

I'm using Delphi 2010 and I have a TToolButton contained by a TToolBar. Assigned to the 'DropdownMenu' property of my TToolButton is a standard TPopupMenu.

The only way I can get the menu to appear is to click on the area pointed to by the red arrow in the image. Currently, clicking the area pointed to by the green arrow shows the button as pressed, but the dropdown menu does not appear.

What I want is if the user clicks anywhere (pointed to by green arrow or red arrow) for the menu to appear. Is it possible to enable this functionality?

Upvotes: 2

Views: 2131

Answers (2)

PersonalNexus
PersonalNexus

Reputation: 1302

The idea of the tbsDropDown style is to have a button that triggers some default action when clicked, but provides more variations of that action in the drop down menu.

If you don't care about the down arrow disappearing, you can set the style to tbsButton and no matter where the button is clicked, it will show the popup menu.

If you are like me and you do want to have the arrow there to indicate that there are more options behind this button, you can call CheckMenuDropdown in the button's OnClicked event handler.

Upvotes: 8

Andreas Rejbrand
Andreas Rejbrand

Reputation: 109168

Set Style to tbsButton. Then you can click anywhere to show the drop-down menu, but you will lose the arrow.

Upvotes: 4

Related Questions