Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 4 Working with Menus, Toolbars, and Dialog Boxes 99


Designer later and edit what you’ve done or add additional menu items—the menu
strip object is fully customizable and with it you can create an exciting menu-driven user
interface like the ones you’ve seen in the best Windows applications.


  1. Click the Type Here tag, type Clock, and then press ENTER.


The word Clock is entered as the name of your first menu, and two additional Type
Here tags appear, with which you can create submenu items below the new Clock
menu or additional menu titles. The submenu item is currently selected.


  1. Type Date to create a Date command for the Clock menu, and then press ENTER.


Visual Studio adds the Date command to the menu and selects the next submenu item.


  1. Type Time to create a Time command for the menu, and then press ENTER.


You now have a Clock menu with two menu commands, Date and Time. You could
continue to create additional menus or commands, but what you’ve done is sufficient
for this example program. Your form looks like the one shown here:


  1. Click the form to close the Menu Designer.


The Menu Designer closes, and your form opens in the IDE with a new Clock menu.
You’re ready to start customizing the menu now.

Adding Access Keys to Menu Commands


With most applications, you can access and execute menu commands by using the
keyboard. In Visual Studio, for example, you can open the File menu by pressing the ALT
key and then pressing the F key. Once the File menu is open, you can open a project by
pressing the P key. The key that you press in addition to the ALT key and the key that you
Free download pdf