Preet Sangha
Preet Sangha

Reputation: 65496

Visual Studio - Is there simple way to add 'Close Solution" to r-click in Solution Explorer

I can't seem to break the habit of always right clicking on the solution to try and close a solution. Then I always remember and take my mouse the great distance across the screen to find it in the File menu.

I don't use it enough to remember a keystroke.

I use VS2008, VS2010 and occasionally VS2012

I'd prefer not to build an addin just for this small task.

Upvotes: 17

Views: 10528

Answers (3)

Arian Khadem zadeh
Arian Khadem zadeh

Reputation: 41

VISUAL STUDIO 2019

Here is the way to do this with COMBINATION KEYS, that it is so better than add it to toolbar or context menu :)

  1. Go to Tools menu
  2. Go to Options
  3. Press Ctrl+E and search Keyboard // OR go to Environment>Keyboard
  4. In right side type CLOSE in search bar(below of "Show commands containing" I mean)
  5. Go down and select the "File.CloseSolution" from the results
  6. Click on the box "Press shortcuts keys:" and specify your combination's key
  7. Be aware that Visual Studio has a lot of default combination keys and do not use any regular shortcut.( I used Ctrl+F4)
  8. Check the "Use new shortcut in:" and select your place that want to use this shortcut (I suggest to use GLOBAL)
  9. Click Assign > OK > Have Fun

Upvotes: 1

abovetempo
abovetempo

Reputation: 150

You can close the solution by simply clicking File->Close Solution in Visual Studio 2017

Close Solution

Upvotes: -2

CodeNaked
CodeNaked

Reputation: 41393

In Visual Studio 2010 you can:

  1. Right click on the Tool menu and click "Customize..".
  2. Click the "Commands" tab.
  3. Click the "Context menu" option.
  4. Select the "Project and Solution Context Menus | Solution".
  5. Click the "Add Command..." button.
  6. Select "File" in the "Categories" list box.
  7. Select "Close Solution" in the "Commands" list box.
  8. Move up/down as desired.
  9. Click "Close" and enjoy.

I don't have VS 2008 or 2012 handy, but the steps should be similar.

Edit: For VS2008

  1. Right click on the Tool menu and click "Customize..".
  2. Click the "Toolbars" tab.
  3. Check the "Context menu" option. (the Context Menus tool bar will appear)
  4. Select Command Tab in the current dialog.
  5. Select "File" in the "Categories" list box.
  6. Select "Close Solution" in the "Commands" list box.
  7. Drag the Command to the "Select the "Project and Solution Context Menus" in the context Menus toolbar. You can drop it anywhere on the menu or in a sub menu - ie "Project and Solution Context Menus | Solution"
  8. Click "Close" and enjoy.

Upvotes: 26

Related Questions