Condividi tramite


Window.SetSelectionContainer Method

Allows setting objects to be active in the Properties window when this window is active.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub SetSelectionContainer ( _
    ByRef Objects As Object() _
)
void SetSelectionContainer(
    ref Object[] Objects
)
void SetSelectionContainer(
    array<Object^>^% Objects
)
abstract SetSelectionContainer : 
        Objects:Object[] byref -> unit
function SetSelectionContainer(
    Objects : Object[]
)

Parameters

  • Objects
    Type: array<System.Object[]%

    Required. An array of objects for the Properties window.

Remarks

Sets the objects that should be passed to the Properties window whenever the window has focus. SetSelectionContainer works only on windows created with the CreateToolWindow method. Other tool windows, such as Solution Explorer and Task List, already have code for setting what is displayed in the Properties window.

SetSelectionContainer allows you to associate objects with the window so that whenever the window has focus, the Properties window displays properties for those objects. For example, you would use this property if you have a custom tool window that displays a chart and you want to display properties in the Properties window in order to change characteristics of the chart.

If SetSelectionContainer is passed an empty Variant value, it removes the displayed object. The object displays when the tool window is active and the objects are available from the selection container.

Examples

SetSelectionContainer requires a tool window. For an example of how to use this method, see the ToolWindow sample on the Visual Studio Automation Samples webpage.

.NET Framework Security

See Also

Reference

Window Interface

EnvDTE Namespace