O'Reilly logo

Beginning Microsoft® Visual Basic® 2008 by Bryan Newsome, Thearon Willis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Creating Menus

Menus are a part of every good application and provide not only an easy way to navigate within an application but also useful tools for working with that application. Take, for example, Visual Studio 2008. It provides menus for navigating the various windows that it displays and useful tools for making the job of development easier through menus and context menus (also called pop-up menus) for cutting, copying, and pasting code. It also provides menu items for searching through code.

This chapter takes a look at creating menus in your Visual Basic 2008 applications. You explore how to create and manage menus and submenus and how to create context menus and override the default context menus. Visual Studio 2008 provides two menu controls in the Toolbox, and you explore both of these.

In this chapter, you will:

  • Create menus

  • Create submenus

  • Create context menus

Understanding Menu Features

The MenuStrip control in Visual Studio 2008 provides several key features. First and foremost, it provides a quick and easy way to add menus, menu items, and submenu items to your application. It also provides a built-in editor that allows you to add, edit, and delete menu items at the drop of a hat.

The menu items that you create may contain images, access keys, shortcut keys, and check marks as well as text labels.

Images

Everyone has seen images on the menus in applications such as Microsoft Outlook or Visual Studio 2008. In earlier versions of Visual Basic, developers were unable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required