I don't understand how the TrackButton property works.
Specifies which mouse button activates the popup menu when it is associated with a toolbar button. Use TrackButton to specify which mouse button activates the popup menu when it is associated with a toolbar button.
So firstly. It only works on a TToolButton and nothing else?
I have a TToolButton with my popup assigned to it via the PopUpMenu property on the TToolButton, but it doesn't seem to work. I set the TrackButton to tbLeftButton, but it still opens with right click?
Or what am I not understanding? Can someone explain how it works please?
This has nothing to do with
TToolBarand also not with any potential button on it.As of Delphi 5
TPopupMenu.TrackButtonis only used inTPopupMenu.Popup(), where its value (of eithertbRightButtonortbLeftButton) is mapped to WinAPI'sTPM_RIGHTBUTTONandTPM_LEFTBUTTONto be used (among others) as flags in the call toTrackPopupMenu(). There those constants have the following meaning:Which means:
.TrackButtonapplies to any popup menu anywhere, and