Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

118 Part I Getting Started with Microsoft Visual Basic 2010



  1. Open the Properties window, click the ShortcutKeys property in the Misc category,
    and then click the arrow in the second column.
    A pop-up menu appears that helps you assign the shortcut key.

  2. Select the Ctrl check box, click the Key list box, and select the letter T in the
    alphabetical list.
    The Properties window looks like this:


Tip Visual Basic normally displays the shortcut key combination in the menu when you
run the program, to give users a hint about which keys to press. To hide shortcut key
combinations from the user (if you’re running out of space), set the ShowShortcutKeys
property to False. The shortcut key still works, but users won’t see a visual reminder for it.
You can also set what will be displayed within the program as a shortcut key by setting the
ShortcutKeyDisplayString property.


  1. Click the Date command, and then change its ShortcutKeys property setting to Ctrl+D.


Now you’ll run the program and try the shortcut keys.


  1. Click the form to close the Clock menu.

  2. Click the Start Debugging button on the Standard toolbar.

  3. Press CTRL+D to run the Date command.


The current date appears in the program.


  1. Press CTRL+T to run the Time command.


The current time appears in the program.
Free download pdf