Chapter 4 Working with Menus, Toolbars, and Dialog Boxes 119
- Click the Clock menu.
The shortcut keys are listed beside the Time and Date commands, as shown in the
following screen shot. Visual Basic adds these key combinations when you define the
shortcuts by using the ShortcutKeys property.
- Close the program.
The Menu program closes, and the development environment appears.
Nice work! You’re ready to move deeper into writing programs now, in the part of the book I
call “Programming Fundamentals .”
Chapter 4 Quick Reference
To Do This
Create a menu item Click the MenuStrip control, and draw a menu on your form. Click the
Type Here tag on your form, and type the name of the menus and
commands that you want to create.
Add an access key to
a menu item
Click the menu item twice to display the I-beam, and then type an
ampersand (&) followed by the letter you want to use as an access key.
Assign a shortcut key
to a menu item
Set the ShortcutKeys property of the menu item by using the
Properties window. A list of common shortcut keys is provided.
Change the order of
menu items
Drag the menu item you want to move to a new location.
Add a toolbar to your
program
Click the ToolStrip control, and then draw a toolbar on your form.
Right-click buttons to customize them. Double-click buttons and write
event procedures to configure them.