Export (0) Print
Expand All

WindowConfiguration Object

Visual Studio .NET 2003

The WindowConfiguration object represents the layout and configuration of all windows in the Visual Studio environment.

DTE

   WindowConfigurations

      WindowConfiguration

[Visual Basic .NET]
Public Interface WindowConfiguration
    Inherits IDispatch
[Visual Basic 6]
Class WindowConfiguration
[C++]
interface WindowConfiguration : IDispatch
[C#]
public interface WindowConfiguration : IDispatch
[JScript .NET]
public interface WindowConfiguration extends IDispatch

Remarks

You can save your current window layout in the Visual Studio environment as a named window configuration. The WindowConfiguration object represents this configuration, which you can later recall using the Apply Method.

Requirements

Namespace: EnvDTE

File: dte.olb

Example

Sub WinConfigExample1()
   ' 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 Long
   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

See Also

WindowConfiguration Creation Example | WindowConfiguration Selection Example | WindowConfigurations Collection | Properties, Methods, and Events

Show:
© 2015 Microsoft