Things You'll Need:
- VB.net
-
Step 1
Open VB.net and create a new project.
-
Step 2
Menus & ToolbarsIn your Toolbox look for the section labeled "Menus & Toolbars".
-
Step 3
MenuStripLook for the item labeled "MenuStrip". Click on it. You will see your mousepointer change from an arror to a smaller icon of the control you are about to add to your form.
-
Step 4
Added to FormNow click on your form to add the Menu strip to your application.
-
Step 5
Now that it has been added to the form we can create some menu options. For our example we will use "File" as out top level menu item and "Exit" as a submenu item under "File".
-
Step 6
FileClick where it says "Type Here". It will change to a textbox where you can type in what the menu item wil display to the user. Type in "File".
-
Step 7
New Menu itemYou will also notice as you click on the area that says "Type Here", a new menu item for you to choose will be created to its right and one below.
-
Step 8
SubmenuIn the new menu item below "File" click where it says "Type Here".
-
Step 9
Exit Menu itemIn the blank box type in "Exit" and hit your enter key on your keyboard. This will be our submenu item. We are now done creating our example menu structure.
-
Step 10
Click eventNow that you have your menu structure complete, it has to do something. For our example we are going to use the Exit submenu item as a means to end the program. Double click on the "Exit" submenu item that you created. This will bring up the menu item's click event.
-
Step 11
CodeIn the click event type in the code:
END
This will end the program. -
Step 12
RunRun your program by clicking the F5 key on your keyboard.
-
Step 13
Click File then click Exit. Notice how your program ends.












