Udostępnij za pośrednictwem


Automation Support for Options Pages

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 is optional, but strongly encouraged, to allow access to this new page through the automation model. You can do this through 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 more information, see Creating Options Pages By Using Interop Assemblies.

For a sample implementing a custom Tools Options page, see Visual Studio Extensibility Samples.

See Also

Concepts

Exposing Project Objects

Other Resources

Options Pages