1 / 11

Creating Menu

Creating Menu. Objectives. Create a menu system for a form Create a menu Create a menu titles Create a menu items Create a submenu Modify menu Edit menu Create event handlers for menus. Creating Menus.

asa
Download Presentation

Creating Menu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Menu

  2. Objectives • Create a menu system for a form • Create a menu • Create a menu titles • Create a menu items • Create a submenu • Modify menu • Edit menu • Create event handlers for menus

  3. Creating Menus • Create menus for a program to give the user an alternative to clicking buttons on a form • Menus reduce the clutter on a form • VB .NET menus work the same way as menus in any other application • Menu bar appears just below a form's title bar • Create menus using the MainMenu control • Control is invisible so it appears in the resizable tray below the from

  4. The MenuItem Class (Properties) • Checked property defines a checked menu item • Check mark appears to the left of the menu item • Enabled property controls whether menu items will respond to events • Disabled menu items appear grayed • Name property has the same meaning as with other controls • ShowShortcut property controls whether a shortcut key will appear if one is defined • Text property controls text appearing in the menu item • Visible property controls whether menu item or menu title is visible • If menu is not visible, sub menus of that menu are not visible

  5. Creating a Menu • Create an instance of the MainMenu control on the form • Use the standard prefix of "mmu" • Create the menu items "in place" in the Win Form Designer • Use descriptive names with the 1st character of each word capitalized • Edit the Name properties as necessary • Create Click event handlers for each menu item

  6. Creating a Menu Click here to edit menu "in place" MainMenu control instance

  7. Creating Menu titles Menu titles appear below title bar

  8. Creating Menu Items Menu items appear below menu titles

  9. Creating a Sub Menu Arrows indicate a sub menu Sub menu

  10. Modifying a Menu • Right-click on the menu you want to modify • Select one of the following from the context menu • Delete to remove the menu title or menu item • Insert New to insert a new menu • InsertSeparator to insert a separator bar • EditNames to edit the Name property for the menus "in place" • ViewCode to activate the Code Editor for the selected menu item • VB .NET will create the Click event handler • Properties to activate the Properties window

  11. Editing Menu Names Menu name appears in brackets

More Related