Show: Object Pascal C++
Adding a Pop-up Menu to a FireMonkey Control
From Appmethod Topics
You can add a pop-up menu to a FireMonkey control by setting the PopupMenu property in the Object Inspector. The pop-up menu appears when you right-click the control at run time.
To add a pop-up menu to a FireMonkey control:
- Open a FireMonkey Desktop Application.
- From the Tool Palette, add to the form a TPopupMenu.
- Double click the pop-up menu to add items to it. If you leave the popup menu empty, nothing happens at run time when you right-click the associated control.
- From the Tool Palette, add to the form a FireMonkey control, such as FMX.StdCtrls.TButton or FMX.Colors.TColorQuad.
- Note that the control you are using must support the PopupMenu property.
- In the Object Inspector, set the control's PopupMenu property to the existing pop-up menu component. (You can select the name of the pop-up menu component after you click the down-arrow for the PopupMenu property.)
- Build and run the application.
- Right-click the control to see the pop-up menu displayed on the mouse position.