How to: Create and Distribute Toolbox Controls

You can create a custom toolbox control in either Visual Basic or C#. There are two project templates you can use, one for a Windows Forms-based control and another for a WPF-based control. You can find these templates at File/New/Project/(Visual Basic or C#)/Extensibility. For more information, see How to: Create a Toolbox Control That Uses WPF or How to: Create a Toolbox Control That Uses Windows Forms.

After you have created your control, you can distribute it to your teammates or publish it on the Web by using the Visual Studio Content Installer. The Content Installer installs .vsi files, which are compressed files that contain the assembly for the control and a manifest that has a .vscontent file name extension.

Important note Important

It is highly recommended that you sign your control component, and that you exercise caution when installing .vsi files you have received from other people or downloaded from the Web.

To create a .vscontent file

  1. Create a new XML file and name it <assemblyName>.vscontent.

  2. Add the following .vscontent template:

    <VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005">
        <Content>
            <FileName></FileName>
            <DisplayName></DisplayName>
            <Description> </Description>
            <FileContentType>Toolbox Control</FileContentType>
            <ContentVersion>2.0</ContentVersion>
        </Content>
    </VSContent>
    
  3. Fill in the <FileName>, <DisplayName>, and <Description> elements with your information.

  4. Save the .vscontent file in the same directory as the assembly that contains the control.

To create a .vsi file

  1. Add the assembly for the custom control and the .vscontent file to a compressed or zip file.

  2. Change the .zip file name extension to .vsi.

To install a .vsi file

  1. Double-click the .vsi file.

    The Visual Studio Content Installer appears.

  2. On the Select Content to Install page, select the item or items that you want to install and then click Next. If the component is not signed, you may see a warning.

    For additional security, click Review to display a list of the files that will be installed on your computer.

  3. On the Content Installation page, click Finish to install the control.

  4. Click Close to exit the installer.

    The control will appear in the My Controls section of the Toolbox.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft