Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide items in the right-click context menus in Visual Studio 2010 (08)?

The right-click context menus of the source editor, the project items and the solution item, is getting ridiculously long, and two of them even have scrolling now on my 1680x1050 screen.

Is there any way for me to hide items on these menus, even if I have to add an event to my Visual Studio macro-system and find and hide them manually?

Here's examples, many of these items I never use:

context menus

Edit1: The current answer + comments suggest I should use the Customize menu item in the toolbar context menus, go to the second tab, Commands, and use the Context Menus radio selection and find the relevant menus there.

Here are 3, which are suggested by comments:

customize context menus

As you can see, they're all empty.

Edit2: After clicking the "Reset All" button in that dialog, for the Solution and Project menus, I got items in the dialog, that I could edit, but the changes did not affect the actual context menu on either a project or the solution file. Also, after restarting Visual Studio, the dialog contents for those two were again empty.

like image 593
Lasse V. Karlsen Avatar asked Mar 15 '11 17:03

Lasse V. Karlsen


People also ask

How do I remove the context menu in Visual Studio?

In Visual Studio 2010 you can: Goto Tools->Customize. Select the Commands tab. Select the Context menu radio button. Select the appropriate context menu from the dropdown list to the right, and delete away.

Where do I find menus in Visual Studio Code?

Menus are declared in the .vsct file of the project. For more information about menus and .vsct files, see Commands, menus, and toolbars. By completing this walkthrough, you can create a menu named Test Menu that contains one command.

How do I empty the context menus in the toolbar?

Edit1: The current answer + comments suggest I should use the Customize menu item in the toolbar context menus, go to the second tab, Commands, and use the Context Menus radio selection and find the relevant menus there. As you can see, they're all empty.

Where do I place menu items in my extension?

Menu items appear in views, actions, and right-click menus. It's important that the grouping of menus remain consistent. If your extension has actions that relate to files, place your actions in the File Explorer context menu (when appropriate).


2 Answers

In Visual Studio 2010 you can:

  1. Goto Tools->Customize
  2. Select the Commands tab
  3. Select the Context menu radio button
  4. Select the appropriate context menu from the dropdown list to the right, and delete away

I believe Visual Studio 2008 is similar.

like image 96
CodeNaked Avatar answered Sep 17 '22 14:09

CodeNaked


You will need to choose the correct context menu in the Customise option.

Go to Tool > Customise,

Then choose the Context menu as you did in your Edit1 screenshots but choose "Editor Context Menus | Code Window" from the dropdown menu instead.

enter image description here

From there you should be able to delete whatever command you don't need from your context menu. Next, for the other commands that can't be found in Editor Context Menus | Code Window (mostly plug-ins or extensions related commands) you will have to go through other categories.

For example, I am using CodeMaid and when I right click a file in Solution Explorer the context menu below are shown

enter image description here

In order to remove the 'Cleanup Selected Code' command I will have to choose the Project and Solution Context Menus | Solution Folder dropdown option.

Added: Here is my sample reduced context menu (removed Copy, Cut, Paste, Outline Menu and Create Snippet...)

enter image description here

Hope this helps =)

Edit: In case you want to add back the commands you removed you can either add them back using New Command... or just press Reset All. Keep in mind the later will restore all the commands. Thus unless you are really having trouble finding the removed command use the first method.

like image 37
wiz_lee Avatar answered Sep 20 '22 14:09

wiz_lee