Visual Studio 2010 IDE : Customizing Visual Studio 2010

9/4/2012 9:22:36 PM
Extensibility is not the only way of customizing the IDE. You can personalize existing features such as the Tools menu, menu commands, and toolbars. In this section you learn how to customize both the Tools built-in menu and toolbars to add functionalities to the environment.

Customizing the Tools Menu

You can customize the Tools menu by providing additional commands pointing to external executables. This is particularly useful if you need to run an external tool against an element within the solution or project. You provide additional commands by selecting Tools, External Tools. This launches the External tools dialog where you can specify the executable name and parameters. For example, imagine you want to add a custom command for launching the Microsoft IL Disassembler for the executable generated by the current project. If you already have any tools in the list (such as the Dotfuscator tool), the first step is clicking the Add button. Then follow these steps:

In the Title text box, write IL Disassambler.

In the Command text box, write the full path for ILDasm.exe. (Generally it is under the Windows SDK tools directory,)

For the Arguments box click the arrow on the right and select Target Path (the related variable is $(TargetPath)). This variable represents the executable generated by the compilation process.

Figure 1 shows the result of this editing. Click OK so that the new command will be added to the Tools menu.

Figure 1. Setting command properties in the External Tool dialog.

Now try to open any existing project and build it; then select the new Tools, IL Disassembler command. If no errors occur, you will see IL Disassembler run and analyze the executable produced by the current project.

Customizing Commands and Toolbars

Visual Studio enables customizing other aspects of the IDE such as menus (including context menus) and toolbars. The next subsections cover both scenarios with examples.

Customizing an Existing Toolbar

Imagine you want to add another button to the Standard toolbar, such as the Close Solution command. Select Tools, Customize. When the Customize dialog displays, select the Commands tab. Then select the Toolbar item and from the related combo box pick up the Standard toolbar. Now the goal is adding a button, so click Add Command. This launches the Add Command dialog; here you just select the menu where the command is located (on the left) and the command itself (on the right). Select File on the left and Close Solution on the right. Figure 2 shows the result of this step.

Figure 2. Selecting the command to be added to the standard toolbar.

When you click OK, the command is added to the desired toolbar, as demonstrated in Figure 3. In the Customize dialog simply click Move Up or Move Down to place the command in the preferred position.

Figure 3. Arranging the command position in the toolbar.

Simply click Close to return to the IDE. You see the command appearing on the Standard toolbar.

Creating a New Custom Toolbar

To create a new custom toolbar, follow these steps:

Select Tools, Customize and make sure that the Toolbars tab is selected.

Click the New button, so that the New Toolbar dialog appears. When ready, type the CustomBar name into the dialog text box and click OK (see Figure 4).

Figure 4. Adding a new custom toolbar.

Select the Commands tab and in the Toolbar combo box, select the CustomBar toolbar; Figure 5 shows how the Customize dialog looks at this particular point.

Figure 5. Preparing the new toolbar for customization.

Click Add Command and follow the instruction explained in the previous section to add as many commands you want in the new toolbar. Figure 6 shows an example.

Figure 6. Configuring the new custom toolbar.

At this point the new toolbar is available in the IDE. To remove it, simply right-click one of the existing toolbars and unselect the new one from the pop-up list.

  •  Visual Studio 2010 IDE : Exporting Templates
  •  System Center Configuration Manager 2007 : Certificate Requirements Planning, Windows Server 2008 Planning
  •  System Center Configuration Manager 2007 : Planning for Internet-Based Clients
  •  Active Directory Domain Services 2008 : Automatically Populate a Migration Table from a Group Policy Object
  •  Active Directory Domain Services 2008 : Create a Migration Table
  •  Microsoft Content Management Server : Developing Custom Properties for the Web Part
  •  Microsoft Content Management Server : Building SharePoint Web Parts - Creating the Web Part, Defining Custom Properties for the Web Part
  •  Microsoft Content Management Server : Building SharePoint Web Parts - The SharePoint MCMS Navigation Control, Creating the Web Part Project
  •  Active Directory Domain Services 2008 : Search Group Policy Objects
  •  Active Directory Domain Services 2008 : Export a Starter GPO, Import a Starter GPO
  •  The Very Successful Hardware That Microsoft Has Ever Produced
  •  Xen Virtualization - Managing Xen : Virtual Machine Manager
  •  Xen Virtualization - Managing Xen : XenMan—Installing and Running
  •  Dual-Core Or Quad-Core?
  •  IBM WebSphere Process Server 7 and Enterprise Service Bus 7 : Getting Started with WID (part 2) - Working with Modules and Libraries
  •  IBM WebSphere Process Server 7 and Enterprise Service Bus 7 : Getting Started with WID (part 1) - Business Integration perspective
  •  Google vs. Apple vs. Microsoft
  •  DSLs in Boo : Implementing the Scheduling DSL
  •  DSLs in Boo : Combining domain-driven design and DSLs
  •  Active Directory Domain Services 2008 : Restore Group Policy Objects and Starter GPOs
    Top 10
    Nikon 1 J2 With Stylish Design And Dependable Image And Video Quality
    Canon Powershot D20 - Super-Durable Waterproof Camera
    Fujifilm Finepix F800EXR – Another Excellent EXR
    Sony NEX-6 – The Best Compact Camera
    Teufel Cubycon 2 – An Excellent All-In-One For Films
    Dell S2740L - A Beautifully Crafted 27-inch IPS Monitor
    Philips 55PFL6007T With Fantastic Picture Quality
    Philips Gioco 278G4 – An Excellent 27-inch Screen
    Sony VPL-HW50ES – Sony’s Best Home Cinema Projector
    Windows Vista : Installing and Running Applications - Launching Applications
    Most View
    Bamboo Splash - Powerful Specs And Friendly Interface
    Powered By Windows (Part 2) - Toshiba Satellite U840 Series, Philips E248C3 MODA Lightframe Monitor & HP Envy Spectre 14
    MSI X79A-GD65 8D - Power without the Cost
    Canon EOS M With Wonderful Touchscreen Interface (Part 1)
    Windows Server 2003 : Building an Active Directory Structure (part 1) - The First Domain
    Personalize Your iPhone Case
    Speed ​​up browsing with a faster DNS
    Using and Configuring Public Folder Sharing
    Extending the Real-Time Communications Functionality of Exchange Server 2007 : Installing OCS 2007 (part 1)
    Google, privacy & you (Part 1)
    iPhone Application Development : Making Multivalue Choices with Pickers - Understanding Pickers
    Microsoft Surface With Windows RT - Truly A Unique Tablet
    Network Configuration & Troubleshooting (Part 1)
    Panasonic Lumix GH3 – The Fastest Touchscreen-Camera (Part 2)
    Programming Microsoft SQL Server 2005 : FOR XML Commands (part 3) - OPENXML Enhancements in SQL Server 2005
    Exchange Server 2010 : Track Exchange Performance (part 2) - Test the Performance Limitations in a Lab
    Extra Network Hardware Round-Up (Part 2) - NAS Drives, Media Center Extenders & Games Consoles
    Windows Server 2003 : Planning a Host Name Resolution Strategy - Understanding Name Resolution Requirements
    Google’s Data Liberation Front (Part 2)
    Datacolor SpyderLensCal (Part 1)