次の方法で共有


How to: Create a Tool Window

The Visual Studio Package Template creates a boilerplate implementation of a simple tool window and the VSPackage that provides it.

To create a tool window by using the Visual Studio Package Template

  1. On the File menu, point to New, and then click Project.

  2. In the New Project dialog box, expand Other Project Types, and click Extensibility.

  3. In the Templates pane click Visual Studio Package.

  4. In the Location box, type the file path for your VSPackage.

  5. In the Name box, type the name for the solution and click OK to start the template.

  6. On the Select a Programming Language page, select C# or Visual Basic. Have the template generate a key.snk file to sign the assembly. Alternately, Browse to your own key file. The template makes a copy of your key file and names it key.snk.

  7. On the Basic VSPackage Information page, specify any details about the VSPackage or accept the defaults. For more information, see Walkthrough: Creating a Menu Command By Using the Visual Studio Package Template.

  8. On the Select VSPackage Options page, check Tool Window.

  9. On the Tool Window Options page, type the name for the title bar in the Window Name box. This name is also used as display text for the menu command for your tool window. The menu command is added to the Other Windows submenu on the View menu. Type the command ID for your tool window in the Command ID box, or accept the default.

  10. Click Finish to create your VSPackage in the folder that you specified.

To test your tool window

  1. On the View menu, point to Other Windows, and then click your tool window command. A tool window with a Click Me! button appears.

  2. Click the button. A message appears with the text:

    We are inside [Company.<VSPackage name>.MyControl].button1_Click().

See Also

Tasks

How to: Open a Tool Window Programmatically

Concepts

VSPackage Essentials