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
TToolBar
and also not with any potential button on it.As of Delphi 5
TPopupMenu.TrackButton
is only used inTPopupMenu.Popup()
, where its value (of eithertbRightButton
ortbLeftButton
) is mapped to WinAPI'sTPM_RIGHTBUTTON
andTPM_LEFTBUTTON
to be used (among others) as flags in the call toTrackPopupMenu()
. There those constants have the following meaning:Which means:
.TrackButton
applies to any popup menu anywhere, and