Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1100545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:53:50+00:00 2026-05-17T00:53:50+00:00

platform:delphi 2010 drop Tmainmenu on form1 drop Tpopupmenu on form1 add mainmenu1 and popupmenu

  • 0

platform:delphi 2010

  1. drop Tmainmenu on form1
  2. drop Tpopupmenu on form1
  3. add mainmenu1 and popupmenu items
    (mainmenu –> file –>item1 , popupmenu–>popup item1)

  4. item1.onRgihtClick show popupmenu
  5. f9
  6. file–>item1 right click, popupmenu , select item1 bla bla bla….
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 222
  ClientWidth = 447
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  Menu = MainMenu1
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object MainMenu1: TMainMenu
    Left = 136
    Top = 64
    object file1: TMenuItem
      Caption = 'file'
      object recentfile1: TMenuItem
        Caption = 'item 1'
      end
    end
  end
  object PopupMenu1: TPopupMenu
    Left = 24
    Top = 136
    object popupitem1: TMenuItem
      Caption = 'popup item'
      OnClick = popupitem1Click
    end
  end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:53:50+00:00Added an answer on May 17, 2026 at 12:53 am

    Here’s the menu structure for the below sample

    File1           Edit1
      FileItem11      EditItem11
      FileItem21      EditItem21
    

    and two popup menu items. The code:  

    type
      TForm1 = class(TForm)
        MainMenu1: TMainMenu;
        File1: TMenuItem;
        FileItem11: TMenuItem;
        FileItem21: TMenuItem;
        Edit1: TMenuItem;
        EditItem11: TMenuItem;
        EditItem21: TMenuItem;
        PopupMenu1: TPopupMenu;
        PopupItem11: TMenuItem;
        PopupItem21: TMenuItem;
        procedure PopupItem11Click(Sender: TObject);
        procedure PopupItem21Click(Sender: TObject);
      private
        FSelectedItem: TMenuItem;
        FTracking: Boolean;
        procedure MenuRButtonUp(var Msg: TMessage); message WM_MENURBUTTONUP;
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    { TForm1 }
    
    procedure TForm1.MenuRButtonUp(var Msg: TMessage);
    var
      Cmd: UINT;
    begin
      if not FTracking then
        FSelectedItem :=
            MainMenu1.FindItem(GetMenuItemID(Msg.LParam, Msg.WParam), fkCommand);
    
      if (not FTracking) and (FSelectedItem <> nil) then begin
        FTracking := True;
        LongBool(Cmd) := TrackPopupMenuEx(PopupMenu1.Handle,
                                TPM_RECURSE or TPM_BOTTOMALIGN or TPM_RETURNCMD,
                                Mouse.CursorPos.X, Mouse.CursorPos.Y, Handle, nil);
        FTracking := False;
        if Cmd <> 0 then
          PopupMenu1.DispatchCommand(Cmd);
      end;
      inherited;
    end;
    
    procedure TForm1.PopupItem11Click(Sender: TObject);
    begin
      Caption := 'Popup Item 1 clicked on ' + FSelectedItem.Caption;
    end;
    
    procedure TForm1.PopupItem21Click(Sender: TObject);
    begin
      // whatever..
      Caption := 'Popup Item 2 clicked on ' + FSelectedItem.Caption;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any Delphi unit available corresponding msctf.h header file from Platform SDK? I
Platform used : Microsoft Visual Studio 2010 (C#) Database : SQL Server 2008 R2
Delphi 2009 sets the default file format for new source code files to ANSI,
Running the following code in Delphi XE2 Win32 platform works. However, the same code
I am writing a Delphi 2010 application. It has many files, two of which
In Delphi XE2, we have use {$ifdef Win32} {$ifdef Win64} to identify which platform
Unit FastCodePatch.pas works in Win32 platform. Delphi XE2 supports Win64 platform, any ideas how
Will the next version of Delphi be released with cross platform support and Qt
Platform: Windows 7, Windows XP Software: DOS I know about command line length limitation
Platform: SQLite on Android. Problem: table has three columns - id, title and order.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.