views:

231

answers:

3

When writing code in .NET, if you use some function in a namespace that has not been included in your page, you get a tooltip-like popup [e.g. System.Data.Sql?]. If you click it, it adds the namespace to your page.
Is there a keyboard short-cut to add the namespace? (I know you can use the right-click button on the keyboard, go to Resolve menu item, and select 'using System.Data.Sql'...I'm hoping for something easier).

EDIT: I understand Ctrl + . also works, but you have to be on the specific command in code.

A: 

Yes its Shift + Alt + F10

Chalkey
A: 

Shift+Alt+F10 brings up the menu, you can then use the arrows and the enter key to select the menu item.

Simon P Stevens
+1  A: 

The default in Visual Studio is Shift + Alt + F10. You can customize this command to be whatever keyboard combination you would like by using the following steps:

  • Select the "Customize" command from the "Tools" menu
  • Select the "Keyboard" button from the bottom of the dialog
  • Assign the command "View.ShowSmartTag" to any keyboard shortcut you like
heavyd
The 'button' you get is called a Smart Tag and is equivalent to the same feature in Microsoft Office. It's interesting to note that the same keyboard shortcut also works in Office (including Outlook), so changing away from the default keyboard shortcut will probably only make your life more difficut :)
Mark Seemann
This may make your life more difficult, only if you have a need to use it in Outlook. For me personally I am always on the keyboard when coding and find it inefficent to have to reach for the mouse, or a strange keyboard-combo like Shift+Alt+F10. Changing it to something more natural can improve productivity. I have never felt that need in applications like Outlook.
heavyd