-
Notifications
You must be signed in to change notification settings - Fork 16
Menus
FellippeHeitor edited this page Jan 4, 2017
·
6 revisions
MenuBar and MenuItem controls provide an easy way to add a menu system to your program.
To add a new MenuBar item, go to Insert menu and choose "Menu Bar". After the menu bar has been created, you can add new items directly on the preview, by clicking the empty space next to the last menu bar item.
To add a new Menu Item, go to Insert menu and choose "Menu Item". You can also add new items directly on the preview, by clicking the empty space in the menu panel.
Menus colors are based on the main form, so they will change accordingly when you edit the main form's color properties.
- Add hot-key shortcuts using the SetCaption (or at design time in the Editor) by adding an ampersand before the desired letter ("&File", "E&xit").
- Add a separator by finishing the item before the desired separator position with a hyphen ("Save &as...-")
- Menu items can have an icon (must be a regular image, not an .ico file though). Just select the "Image file" property in the editor and enter an image file name. It'll be instantly loaded and shown. (in code you must use the LoadImage method).
- Menu items can be checked. Just set the Value property to -1 (or True if you change their selected status in code). ** If a menu item contains an image icon, it'll not be shown when the item is "checked", so these are mutually exclusive properties.
- The last menu item can be aligned to the right on the menu bar. Just select it and choose "Right" in the "Text align" drop-down list.
- After you've added a menu item or menu bar item you can reorder them by changing their z-order (Edit->Z-ordering).
###Events
###Methods
###Properties editable at runtime