Extend Menu Items to right

Posted on 2011-04-29
Last Modified: 2012-05-11
I have an application in which I would like to have one of the menu items (a column) to appear far to the right of the form. Can I add several empty colums to the main menu to push the last column far to the right ? Can I add a second main menu and place it far to the right ? Is there another component I can add which will look and act like a column in the main menu ?
Question by:ChLa
    LVL 32

    Expert Comment


    You can not add empty spaces.

    Basically you have to build your own menu component to do something like this.

    You can try playing around with TActionManager, TActionMainMenuBar and TActionToolBar but it still wont give exactly what you are looking for
    LVL 24

    Accepted Solution

    You can use the following code from About articles:
    procedure TForm1.FormCreate(Sender: TObject) ;
      mii: TMenuItemInfo;
      MainMenu: hMenu;
      Buffer: array[0..79] of Char;
      MainMenu := Self.Menu.Handle;
      //GET Help Menu Item Info
      mii.cbSize := SizeOf(mii) ;
      mii.fMask := MIIM_TYPE;
      mii.dwTypeData := Buffer;
      mii.cch := SizeOf(Buffer) ;
      GetMenuItemInfo(MainMenu, HelpMenuItem.Command, false, mii) ; //HelpMenuItem is the item you want to align to the right
      //SET Help Menu Item Info
      mii.fType := mii.fType or MFT_RIGHTJUSTIFY;
      SetMenuItemInfo(MainMenu, HelpMenuItem.Command, false, mii) ;

    Open in new window


    Author Closing Comment

    The solution worked. I addes a few spaces after the last menu item to push it away from the right edge so it is where I wanted it.
    LVL 32

    Expert Comment



    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now