|
Free
computer Tutorials
|
![]() |
home |
Stay
at Home and Learn
|
||||||
Add Shorcuts to your Menu Items |
|||||||
|
This tutorial assumes that you have completed the first one. In the previous tutorial, you learned how to add Sub Menus to your VB .NET forms. In this part, you'll see how to add shortcuts to your menu items
Underline ShortcutTo add an underline, do this:
Notice that "N" of New is now underlined. If you want an underline shortcut, the ampersand character should be typed before the letter you want underlined. Add underlines for the "F" of you File menu, the "O" of Open, the "S" of Save, and the "X" of Exit. When you're done, your menu should look like this one:
Time to see if your shortcut works. Run your programme. To use the underline shortcuts on menus, you first hold down the Alt key on your keyboard. Then type the underline character.
All that and you didn't have to write a single line of code!
No more reading these lessons online - get the eBook here! Key combination shortcutsA key combination shortcut is one that appears at the end of a menu item (Ctrl + N, for example). You can easily add this option to your own programmes. So try this:
Run your programme and test out the shortcut. Don't click the File menu. Just hold down the Ctrl key on your keyboard. Then press the letter X. Again, the programme will close down. You can add these types of shortcuts to any menu item. Just remember to choose a different key stroke combination for each one. And don't have too many of them - they'll spoil the look of your menu!
Now that you know how to add Menus, Sub Menus and Shortcuts it's time for you to complete your own menu bar. Click the project below to see what you need to do. It's not very difficult! In the section after the project, you'll see how to add code for your new menu bar.
Click here for the VB .NET Menu Project--> <--Back to the .NET Contents Page View all our Home Study Computer Courses
|