Mega Code Archive

 
Categories / Delphi / VCL
 

Getting a cool menu in your app

Question: I want to have a menu that looks like Delphi 4's menu in my app. How can I do that? Answer: 1. Drop down a TControlBar. Align it to Client. 2. Drop down a TToolBar inside of the TControlBar. 3. Set Flat and ShowCaptions of the TToolBar to True. 4. Create as many TToolButtons on the TToolBar as you'd like. 5. Set Grouped to True for all TToolButtons. This will enable your menu to pop up menu after menu as you sweep across the menu (if a menu is already pulled down). 6. Drop down a TMainMenu, and make sure it's *not* attached to the form it's on. 7. Create the entire menu, with all its entries. 8. For each TToolButton, set its MenuItem to the corresponding menu item in the TMainMenu.