Condividi tramite


Customize Your Toolbars in Visual Studio 2008: Commands Tab

Menu:  Tools -> Customize
Command:  Tools.Customize
Versions:  2008
Published:  7/31/2010
Code:  vstipEnv0033

 

You can customize any toolbar in Visual Studio 2008.  Just click on the drop-down to the right of any toolbar then click on "Add or Remove Buttons" and choose "Customize":

image_thumb[2]

 

Alternatively, you can go to Tools -> Customize on the Menu Bar:

image_thumb[4]  image_thumb[5]

 

 

Whichever option you choose, you will get the Customize Dialog:

image_thumb[10]

 

In this case we are going to look at the Commands Tab:

image

 

 

 

The best way to learn how to customize menus and toolbars is to do an example.  In this case, we want to add the ability to select some code then RIGHT CLICK and comment or uncomment the code.

 

First, we have to go back to the Toolbars Tab and pick the menu or toolbar you want to modify.  For our example, we will choose the Context Menus:

image

 

Now we click on the Commands Tab and locate the items we want to add.  In this case, we dig a bit and find "Selection Comment" and "Selection Uncomment" on in the Edit section:

image

 

Now we have to see which menu we want to modify.  Click on the Editor Context Menus -> Code Window to see where we want our items to go:

image

 

Now CLICK AND DRAG your items where you want them on the menu:

image

 

If you want, you can click on the Modify Selection button to reset, delete, modify the name, modify the button image, change the way the item is displayed, or begin a new group:

image

 

We would like the new buttons to be in their own group so click on the item just BELOW where we want our group to be:

image

 

Now choose "Begin a Group" from the Modify Selection button to get a new group line:

image

 

That's it!  Close the Customize dialog then select some code and RIGHT CLICK to see if your items show up:

image

 

Enjoy!