Ross Sheppard High School
Computer Programming 20
Student Learning Guide
The Popup Menu Program


  When you have finished this project, you will be able to:
modify a menu
create a fly-out menu
create a popup menu
  1. Create a new folder called Popup Menu on your personal drive.

  2. COPY all of the files from the Color Folder to the Popup Menu Folder.

  3. Start Visual Basic and open the program from the Popup Menu Folder.

  4. Save the form and the project as Popup Menu Program.

  5. Think about what the menu selections looked like in the Colors Program. Run the program to refresh your memory.

  6. In the Colors Program, you learned how to create menu items and write code for them. In this project, you will learn how to make fly-out windows and popup menus.

  7. The first thing you need to do is to modify the current menu structure. Make sure you are in the Form View window.

  8. Open the Menu Editor, and you will see what the current menu items look like.

  9. Insert a new menu item between File and Red:

  10. Indent the color choices by clicking the right arrow.

  11. Click OK, then run your program.

  12. When you select File on the menu bar, the Colors option should be visible with an arrow indicating there is a fly-out menu.

  13. Hover the mouse on the Colors option to see the fly-out menu.

  14. Try all of the menu items - they should work the same way as they did in the Colors Program.

  15. Using fly-out menus is a good method of making the Menu Bar menus shorter and easier to read.

  16. With the implementation of Windows 95 and later versions, Microsoft allowed for the use of the right mouse button to provide quick access to certain menus for the user. By right clicking on an object, a user can call up a menu that is specific to that object. This is called a popup menu.

  17. A popup menu is created by adding some code to the code portion of the program, on the Form object.

  18. Enter the Code View window.

  19. Choose the Form Object and the MouseUp Event.

  20. Next, add the following code to the Form_MouseUp procedure that was added.

  21. Run your program and right click the mouse anywhere on the form where there is no other object. The popup menu should appear.

  22. Try each of the popup menu items - they should all work exactly as the items in the Menu Bar.

  23. From this point on, you must include context sensitive and fly-out menus when appropriate to enhance the usability of a program.

  24. Click here to see the marking guide for this project.

  25. When you have finished, send an email to your teacher asking that this project be marked.


© 1998-2000 N.F. Mathew, EdD
File name: Popup Menu.htm
Last updated on October 18, 2000