Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

WindowConfigurations Interface

The WindowConfigurations collection contains all named window configurations created for the environment.

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

<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")> _
Public Interface WindowConfigurations _
	Inherits IEnumerable

The WindowConfigurations type exposes the following members.

Public propertyActiveConfigurationNameGets the name of the currently active window configuration.
Public propertyCountGets a value indicating the number of objects in the collection.
Public propertyDTEGets the top-level extensibility object.
Public propertyParentGets the immediate parent object of a WindowConfigurations collection.

Public methodAddCreates a new named window configuration based on the current arrangement of windows, adds it to the WindowConfigurations collection, and retains it for future recall.
Public methodGetEnumeratorGets an enumeration for items in a collection.
Public methodItemReturns an indexed member of a WindowConfigurations collection.

You can save your current window layout in the Visual Studio environment as a named window configuration. The WindowConfigurations collection contains all such configurations.

Sub WinConfigurationsExample(ByVal dte As DTE)
    ' This example lists all currently available named window 
    ' configurations.
    ' Set references to all necessary objects.
    Dim colWinConfig As WindowConfigurations
    Dim objWinConfig As WindowConfiguration

    colWinConfig = dte.WindowConfigurations

    MsgBox("Number of configurations: " & colWinConfig.Count)
    ' List all saved named window configurations
    ' Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout")
    ' Get rid of the new window configuration.
    MsgBox("Number of configurations: " & colWinConfig.Count)
End Sub

Sub FillMsg(ByVal colWinConfig As Object)
    ' Lists all currently available named window configurations.
    Dim lCtr As Integer
    Dim strMsg As String

    For lCtr = 1 To colWinConfig.Count
    strMsg = strMsg & "Configuration name " & lCtr & ": " & _
    colWinConfig.Item(lCtr).Name & vbCr
    Next lCtr
    strMsg = "Current Configurations: " & vbCr & strMsg
End Sub
© 2015 Microsoft