Menu Control: – An application menu system is constructed from menu controls. Each menu name, menu command and separator bar is a separate control. When we create menu controls, we name them with MNU prefix. We placed the text we went to displayed by a menu control is its caption properties. As with other controls, access keys are assigned by an ampersand sign in the caption properties before the character that is to because the access key. The names of the controls that are the commands of the menu. Write other controls in visual basic, menu controls have properties and respond to events. We make a menu functional by writing click event procedure for the control.

Menu editor: – We create menu control with menu editor. We start menu editor with one of the following action.

  1. Click the menu editor button from the standard toolbar. Or
  2. Click tools menu from menu bar then click on menu editor option from tools menu. Or
  3. Press CTRL+E, in all cases, a menu editor dialog box will open. This dialog box divided into two parts vertically. First part contains, caption, name, index, shortcut, help contest id, negotiate position text boxes and list boxes and it also contains four check boxes such as checked, enable, visible and window list. There are mine command button also available in this area for different operation. Second help portion of the dialog box displayed as empty. When user choose menu name, menu command, such command, etc., it appear on this area. Here are description of the field that we will used in this text.
    1. Caption: – A caption is used for menu name which is displayed in the menu list. We can assign an ampersand sign before a character in the caption. If we want the control to be a separator bar, the caption should be sets to a hyphen (-).
    2. Name: – The name text box is used to assign a name of menu, menu command, sub menu and show on. We can use only this name in visual basic program. Normally name can be prefix with MNU. Type the name of the menu control in this filled.
    3. Shortcut: – A shortcut is dropdown list box. When we click on dropdown arrow, a list of shortcut name are displayed on dialog box. Select any one shortcut key out of multiple option by clicking on it.
    4. Enabled: – This field is checked by default, which causes the menu control to initially appear enabled. Uncheck it to cause the control initially appear disabled.
    5. Checked: – This is also a check box. This check box is used to enable or disable any command control. By default initially check mark appear with this command.

Upper half of the dialog box contains to command button and button half of the dialog box has a set of button with arrows as well as buttons labeled next, insert and delete. The upper half dialog box contains two button labeled ok and cancel. The ok button used to save and exit from the dialog box and cancel button is used to exit without save. The menu list box shows a list of menu control we have created on the form. We edit and existing control position in the menu system by selecting it in the list box and them using one of these button. Here is a description of each button.

  1. Right arrow: – When we click this button the selected menu control moves down one level in the menu system hierarchy. If the selected menu control is a menu name which this button is selected, it becomes a menu command. If it is a menu command when this button is clicked, it becomes a sub menu command.
  2. Left arrow: – When we click this button the selected menu control moves up on label in the menu system hierarchy. If the selected menu control is a sub menu command when this button is clicked, it becomes a menu command. If it is a menu command when this button is clicked, it becomes a menu name.
  3. Down arrow: – When we click this button the selected menu control moves down one position in the list.
  4. Up arrow: – When we click this button the selected menu control moves up one position in the list.
  5. Next: – When we click this button the control below the currently selected control becomes the selected control.
  6. Insert: – When we click this button a new menu control is inserted into the menu system directly above the currently selected control.
  7. Delete: – When we click this button the selected menu control is deleted.
Advertisements