Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 709
Preet Sangha Avatar asked Jun 30 '12 01:06

Preet Sangha


People also ask

How do I change the Solution Explorer view in Visual Studio?

Open Solution Explorer If you don't see the Solution Explorer tool window, you can open it from the Visual Studio menu bar by using View > Solution Explorer, or by pressing Ctrl+Alt+L.

Which option is used to close the solution in VB?

10. Which option is used to close the IDE? Explanation: Close is used to close the IDE. Close Solution is required to close the solution.

How do I navigate the Solution Explorer in Visual Studio?

The default keyboard shortcut for opening/jumping to Solution Explorer is Ctrl + Alt + L .

What is the advantage of Solution Explorer in Visual Studio?

Solution Explorer is a special window that enables you to manage solutions, projects, and files. It provides a complete view of the files in a project, and it enables you to add or remove files and to organize files into subfolders.


2 Answers

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.
like image 110
CodeNaked Avatar answered Nov 15 '22 23:11

CodeNaked


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
like image 30
Arian Khadem zadeh Avatar answered Nov 16 '22 00:11

Arian Khadem zadeh