Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB.NET
Expertise: Beginner
Oct 19, 2004

Creating Custom Keyboard Shortcuts in VS.NET

Keyboard shortcuts are extremely useful when you use a particular option repeatedly—like when you select menus or toolbars manually. Sometimes, the default shortcut is cryptic and you cannot remember it. Otherwise, the shortcuts do not exist at all. Here is how you can assign your own custom shortcuts to the actions you use very often.
  1. Start Visual Studio.
  2. Choose Tools—>Customize.
  3. Click on the button Keyboard.
  4. A complex looking dialog will appear.
  5. The left section lists the various items which are customisable. Keyboard will be selected in this case.
  6. The settings you change may interfere with settings of other users who may share your machine. To avoid this, save your settings as a collection of named settings. Before you customise anything, click on Save As and choose a different name for your collection of settings.
  7. Type part of the menu or toolbar button for which you would like to assign a shortcut key in the textbox Show Commands Containing. This launches a substring search on all the commands and returns a filtered list. Browse the set of commands and locate the one you want.
  8. If the command already has a key assigned, view it. It is possible that there is a shortcut key that is not shown in the menus. If this is the case, memorise the shortcut and exit this dialog. No customisation is required.
  9. If there's no shortcut, or you dont like the default shortcut, customise it. Locate the command and go to the Press shortcut key(s) textbox. Press the required combination. VS understands which keys you pressed and puts their names there. Remember that you can specify multiple shortcuts for a single command.
  10. It's possible that the keyboard shortcut that you are trying to use is already used by VS.NET for some other existing command. If so, this command will be listed. You can override this shortcut and map it to the command selected by you. If you dont want to disturb the current assignment, type a new keyboard shortcut. Remember to delete the existing shortcut before you type the new one.
  11. Click on Assign.
This can dramatically increase your productivity and efficiency while working on VS.NET.

Note: It is possible that you need different types of shortcuts depending upon the type of project (winform/Webform) or the type of file being edited. For such custom requirements, save your shortcut settings under different names and load the appropriate collection as per your needs.

Varun Gupta
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap