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 in TPopupMenu.Popup(), where its value (of either tbRightButton or tbLeftButton) is mapped to WinAPI's TPM_RIGHTBUTTON and TPM_LEFTBUTTON to be used (among others) as flags in the call to TrackPopupMenu(). There those constants have the following meaning:
constant value description TPM_LEFTBUTTON 0 The user can select menu items with only the left mouse button. TPM_RIGHTBUTTON 2 The user can select menu items with both the left and right mouse buttons.
Which means:
.TrackButton applies to any popup menu anywhere, andIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With