共用方式為


How to: Provide a Custom Properties Window

It is possible to provide your own Properties window for a given project system, instead of extending the Properties window provided by the Visual Studio integrated development environment (IDE). The most-often encountered scenario is when you yourself implement the object sited in the window frame.

In the event you do not implement the object sited in the window frame, but do still have access to it by some other means, there are a number of ways to access the IVsWindowFrame interface as listed in the last procedure on this page.

To provide your Properties window

  1. Define a GUID that represents your Properties window implementation.

  2. In your SetSite implementation, use the IProfferService service to proffer your Properties window as a service to the Visual Studio Environment.

To call your properties window

  1. Call the SetSite method.

  2. QueryService for SVsTrackSelectionEx from the IServiceProvider passed into the SetSite method.

  3. Obtain IVsTrackSelectionEx from SVsTrackSelectionEx service.

  4. Call OnElementValueChange with first parameter set to SEID_PropertyBrowserSID (taken from the VSConstants.VSSELELEMID enumeration), and the third parameter, varValue, representing a string form of the GUID that represents your Properties window. Make this call only once at the first creation of your Properties window document window. After the call this Properties window is associated with your window frame.

To obtain the Window Frame object when you are not the implementer

See Also

Concepts

Properties Window Fields and Interfaces

Other Resources

Properties Window and Property Pages