Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— 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 1 st character of each word capitalized Edit the Name properties as necessary Create Click event handlers for each menu item

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

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 Sub menu Arrows indicate a 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 –Insert Separator to insert a separator bar –Edit Names to edit the Name property for the menus "in place" –View Code 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


Download ppt "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."

Similar presentations


Ads by Google