• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Extend Menu Items to right

Hi,
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 ?
0
ChLa
Asked:
ChLa
  • 2
1 Solution
 
Ephraim WangoyaCommented:

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
0
 
jimyXCommented:
You can use the following code from About articles:
procedure TForm1.FormCreate(Sender: TObject) ;
var
  mii: TMenuItemInfo;
  MainMenu: hMenu;
  Buffer: array[0..79] of Char;
begin
  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) ;
end;

Open in new window

0
 
ChLaAuthor Commented:
The about.com 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.
0
 
Ephraim WangoyaCommented:

Nice
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now