Popup menu for a Delphi Firemonkey form

Unlike VCL forms, Delphi FireMonkey forms do not have a PopupMenu property.  So how can you show a popup menu when the user clicks the Right Mouse Button ?

You have to code it yourself and its pretty easy to do.  The tricky bit is converting the X/Y  position from the forms local co-ordinate system to global co-ordinates.  Ill show you to do that.



  1. Create a popup menu on the form
    Add menu items to it in the usual way.
    I presume you know how to do.


2. Create an OnMouseDown event for the form with this code

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single);
   vPoint : TPointF;
// show popup menu when right mouse button
   if Button = TMouseButton.mbRight then
                       -- convert local XY to global XY
      vPoint := Self.ClientToScreen(PointF (X,Y));
      PopupMenu1.Popup(vPoint.X, vPoint.Y);

3. Run the project (F9 Key)

4. Right click on the form.
The popup menu should appear at the mouse location

Convert local co-ordinates to global co-ordinates

Popup menus can be displayed anywhere on the screen, even outside of the form’s display area.  As a result, the X/Y position for the popup menu is defined using global coordinates instead of the Forms local co-ordinates.

The above code converts the X and Y arguments from local co-ordinate to global co-ordinates like this:

vPoint := Self.ClientToScreen(PointF (X,Y));

+1 this post

If you like this post, please +1 vote here to get it listed on Delphi Feeds and also here on BeginEnd.  Thank You

About Me


  • Oracle & Delphi software developer based in Perth, Western Australia
  • Australian Delphi User Group – WA Chief Cat Herder
  • Australian Delphi User Group – President
blog email linkedinlogo

Author: Scott Hollows

Enterprise software developer based in Perth, Western Australia. Oracle, Delphi, Data Warehouse design and ETL, Data Architect, Business Intelligence, Oracle performance tuning. Oracle ApEx, Discoverer, BI Publisher, OBIEE, Forms, Reports, SQL, PLSQL. Blockchain software development, cryptocurrency exchange integration and trading analysis Australian Delphi User Group (ADUG) - WA branch manager and past national president LinkedIn www.linkedin.com/in/scotthollows

One thought on “Popup menu for a Delphi Firemonkey form”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: