Creating Menu and Menu Items
In this tutorial we will learn about Creating Menu and Menu Items – Main Menu, Context Menu, StatusBar and ToolBar.
Main Menu
Windows users are familiar with Menu objects. The MainMenu control represents the container for the menu structure of the form. Menus are made up of MenuItem objects that represent the individual parts of a menu. You can add submenus to menus that will pop up when the user clicks an arrow in the menu item, display check marks, create menu separators, assign shortcut keys to menu items , even draw the appearance of menu items yourself.
MenuItems in a MDI application work in a special way. When an MDI child window appears, its menu is merged with the MDI parent window. You can also specify how this menu is to be added to the MDI parent window with the MergeOrder and MergeType properties.
Context Menu
Another popular type of menu is the context menu. The context menus are invoked by right clicking on another control. We can use context menus to display menus that will be specific for that control. You can achieve this by setting the ContextMenu property of the control with the name of the menu created separately.
StatusBar
A StatusBar is usually seen at the bottom of the window and they provide the user with some additional information– such as– the page number they are editing. You can also add panels to the status bar so that different groups of information are shown in different parts of the bar. The ShowPanels property enables you to determine if the panels will be shown or not.
ToolBar
Toolbars are seen below the menus and are full of buttons. The buttons that appear in the tool bar can appear in many ways depending upon the options chosen. They can appear as standard push buttons, toggle buttons, drop-down buttons that can display a drop down menu and buttons that display images.
Toolbars are usually docked along the top of its parent Window. They can actually docked to any side of the window. Toolbars can display tool tips when the user points the mouse pointer at a toolbar button. The toolbars allow the users to access the most often used options to be grouped displayed dynamically depending up on the control that is currently active.