Mega Code Archive

 
Categories / Delphi / Ide Indy
 

How to Break a Long Menu into Columns in a Delphi application

Title: How to Break a Long Menu into Columns in a Delphi application 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;