When you are finished, click elsewhere on the screen. 14.4), use the CheckBoxes and dropdown list to select the shortcut keys. To do this, select the down arrow to the right of this property in the Properties window. To add other shortcut keys (e.g., -F9) for menu items, set the ShortcutKeys property of the appropriate ToolStripMenuItems. For example, to create the File menu item with the letter F underlined, type &File. To create an access shortcut (or keyboard shortcut), type an ampersand ( &) before the character to be underlined. Adding ToolStripMenuItems to a MenuStrip. Editing menus in Visual Studio.įigure 14.3. Then more Type Here TextBoxes appear, allowing you to add items underneath or to the side of the original menu item (Fig. After you press the Enter key, the menu item name is added to the menu. This action adds an entry to the menu of type ToolStripMenuItem. To add menu items to the menu, click the Type Here TextBox (Fig. Menus, like other controls, have properties and events, which can be accessed through the Properties window. You can now use Design mode to create and edit menus for your application. To select the MenuStrip, click this icon. This creates a menu bar across the top of the Form (below the title bar) and places a MenuStrip icon in the component tray. To create a menu, open the Toolbox and drag a MenuStrip control onto the Form. Some menu items display check marks, usually indicating that multiple options on the menu can be selected at once. Menus that are not top-level menus can have shortcut keys as well (combinations of Ctrl, Shift, Alt, F1, F2, letter keys, etc.). Menus, submenus and menu items.Īll menu items can have Alt key shortcuts (also called access shortcuts or hotkeys), which are accessed by pressing Alt and the underlined letter (for example, Alt F typically expands the File menu). A menu item that contains a submenu is considered to be the parent of that submenu.įigure 14.1. The menu that contains a menu item is called that menu item's parent menu. Notice that the top-level menus appear in the left portion of the figure, whereas any submenus or menu items are displayed to the right. 14.1, an expanded menu from Visual Studio lists various commands (called menu items), plus submenus (menus within a menu). Menus are an integral part of GUIs, because they organize commands without "cluttering" the GUI. Although these commands depend on the program, somesuch as Open and Saveare common to many applications. Menus provide groups of related commands for Windows applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |