This documentation is archived and is not being maintained.

WindowConfigurations Interface

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

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

'Declaration
<GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE")> _
Public Interface WindowConfigurations
	Inherits IEnumerable
'Usage
Dim instance As WindowConfigurations

/** @attribute GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE") */ 
public interface WindowConfigurations extends IEnumerable
GuidAttribute("E577442A-98E1-46C5-BD2E-D25807EC81CE") 
public interface WindowConfigurations extends IEnumerable

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
    FillMsg(colWinConfig)
    ' Create a new window configuration.
    objWinConfig = colWinConfig.Add("NewLayout")
    FillMsg(colWinConfig)
    ' Get rid of the new window configuration.
    objWinConfig.Delete()
    MsgBox("Number of configurations: " & colWinConfig.Count)
    FillMsg(colWinConfig)
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
    MsgBox(strMsg)
End Sub
Show: