Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

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


Try adding access keys to the Clock menu now.

Add access keys


  1. Click the Clock menu name on the form, pause a moment, and then click it again.


The menu name is highlighted, and a blinking I-beam (text-editing cursor) appears at the
end of the selection. With the I-beam, you can edit your menu name or add the ampersand
character (&) for an access key. (If you double-clicked the menu name, the Code Editor
might have opened. If that happened, close the Code Editor and repeat step 1 .)


  1. Press the LEFT ARROW key five times to move the I-beam to just before the Clock
    menu name.
    The I-beam blinks before the letter C in Clock.

  2. Type & to define the letter C as the access key for the Clock menu.


An ampersand appears in the text box in front of the word Clock.


  1. Click the Date command in the menu list, and then click Date a second time to display
    the I-beam.

  2. Type & before the letter D.


The letter D is now defined as the access key for the Date command.


  1. Click the Time command in the menu list, and then click the command a second time
    to display the I-beam.

  2. Type & before the letter T.


The letter T is now defined as the access key for the Time command.


  1. Press ENTER.


Pressing ENTER locks in your text-editing changes. Your form looks like this:
Free download pdf