Compartilhar via


Automation support for Options pages

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

VSPackages can provide custom Options dialog boxes to the Tools menu (Tools Options pages) in Visual Studio and can make them available to the automation model.

Tools Options pages

To create a Tools Options page, a VSPackage must provide a user control implementation returned to the environment through the VSPackage's implementation of the GetPropertyPage method. (Or, for managed-code, the GetPropertyPage method.)

It's optional, but strongly encouraged, to allow access to this new page through the automation model. You can do so with the following steps:

  1. Extend the Properties[] object through the implementation of an IDispatch-derived object.

  2. Return an implementation of the GetAutomationObject method (or for managed code the GetAutomationObject method) to the IDispatch-derived object.

  3. When an automation consumer calls the Properties[] method on a custom Option property page, the environment uses the GetAutomationObject method to obtain a custom Tools Options page's automation implementation.

  4. The automation object of the VSPackage is then used to provide each Property returned by Properties[].

    For a sample implementing a custom Tools Options page, see VSSDK Samples.

See also