1. Home
  2. Computing & Technology
  3. Delphi Programming

How to Break a Long Menu into Columns

By Zarko Gajic, About.com

Most applications have some kind of menu to help users select an action in a program. In Delphi, you can easily create the main menu of the application by placing a TMainMenu component on a form (or a pop up menu with the TPopupMenu component).

When adding sub-items to a menu, for example in a MRU (most recently used file list) menu, you migth want to break menu items into columns.

Property "Break" of the TMenuItem (one item in a menu) determines whether the menu item starts a new column in the menu. By default, the value of this property is "mbNone". If you set this property to "mbBarBreak" or "mbBreak" (either using the Object Inspector at design time, or from code at run time) you can break a long menu into columns at the item described by this menu item.

var
  newColumnMenuItem : TMenuItem;
begin
  ...
  newColumnMenuItem.Break := mbBarBreak;
  ...
end;

Delphi tips navigator:
» How to Drop Images from Windows Explorer to a TImage control
« How to Change the Default Windows Printer from Code

More Delphi Programming Quick Tips
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2005 Delphi Tips
  7. How to Break a Long Menu into Columns in a Delphi application

©2009 About.com, a part of The New York Times Company.

All rights reserved.