Click to Rate and Give Feedback

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Studio Automation and Extensibility 
How to: Create Custom Tools Options Pages 

The Options dialog box on the Tools menu displays a variety of option pages for different parts of Visual Studio. You can control the existing options pages, as outlined in Controlling Tools Options Settings, and you can also create your own custom pages. You can use custom pages to allow users to change settings for your add-ins or other programs.

Creating your own custom Tools Options pages is easier than ever before. You no longer need to use an add-in to create a new Tools Options page because the page definitions are now stored in separate XML files rather than in registry keys. Consequently, you can now create Tools Options pages that are accessible in the Macros integrated development environment (IDE) as well as the main Visual Studio IDE.

The following procedure demonstrates how to create a custom user control that will act as a custom Tools Options page, and then modify a .Addin file to reference it.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. These procedures were developed with the General Development Settings active. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To create a custom Tools Options page

  1. Create a new Windows Control Library project. Name it ToolsOptionsLibrary.dll.

  2. Add the controls and functionality you desire to the user control.

    This user control will become the custom Tools Option page. You should resize the control to fill the Tools Options dialog box client area.

  3. Build the project.

    Visual Studio looks for all shared .Addin files when it starts and loads those that are present. The Tools Options page named Add-in/Macros Security defines a set of tokens for file paths for .Addin files. The following tokens are included:

    • %ALLUSERSPROFILE%

    • %APPDATA%

    • %USERPROFILE%

    • %VSAPPDATA%

    • %VSCOMMONAPPDATA%

    When Visual Studio begins searching for .Addin files, it replaces these tokens with the following path strings:

Token Path

%ALLUSERSPROFILE%

<drive>:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins

%APPDATA%

<drive>:\Documents and Settings\<username>\Microsoft\MSEnvShared\Addins

%USERPROFILE%

<drive>:\Documents and Settings\<username>\My Documents\Visual Studio 2005\Addins

%VSAPPDATA%

<drive>:\Documents and Settings\<username>\Addins

%VSCOMMONAPPDATA%

<drive>:\Documents and Settings\All Users\Addins

For more information about registering add-ins, see Add-In Security.

In addition to this example, you can download a full-featured Tools Option page from the Visual Studio Automation Samples Web site. See the RegExplore sample on the Automation Samples site. This example, however, shows how to create a Tools Options page using a COM control.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
IDTToolsOptionsPage Interface      Dave Sexton   |   Edit   |   Show History

Adding a tools options page can be accomplished easily in Visual Studio 2005 without any ActiveX shim or registry manipulation:

1. Create a UserControl that implements the EnvDTE.IDTToolsOptionsPage interface in a class library project or a project serving as an add-in.

2. Create an add-in for your options page either in the same project as the options page control or a different project.

3. Register your options page control with your add-in using the ToolsOptionsPage xml element in your .AddIn file.

4. Your options page will be available as soon as your add-in is loaded into the Visual Studio IDE.

Related Links

Visual Studio Automation and Extensibility
How to: Create an Add-in
http://msdn2.microsoft.com/en-us/library/80493a3w(VS.80).aspx

Code & Seek [example tools options page]
Bring Windows Desktop Search Into Visual Studio With Our Cool Add-In
http://msdn.microsoft.com/msdnmag/issues/06/07/CodeAndSeek/default.aspx

E. Dore [MSFT], Create custom tools Options pages, Jan 4 2006
http://groups.google.com/group/microsoft.public.vstudio.extensibility/browse_frm/thread/8451eaf40c75e2f8/7d9c26349ec70782?lnk=st&q=IDTToolsOptionsPage&rnum=9#7d9c26349ec70782

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker