WindowConfiguration.Apply(Boolean) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Invokes a previously saved named window configuration.
void Apply(bool FromCustomViews = true);
[System.Runtime.InteropServices.DispId(3)]
public void Apply (bool FromCustomViews = true);
[<System.Runtime.InteropServices.DispId(3)>]
abstract member Apply : bool -> unit
Public Sub Apply (Optional FromCustomViews As Boolean = true)
- FromCustomViews
- Boolean
If this is true
, the named view in the custom window configuration persistence is the search target. If this is false
, then the installed, predefined persistence of window configurations is searched. The default is true
.
- Attributes
Sub ApplyExample(dte as DTE)
' Set references to all necessary objects.
Dim colWinConfig As WindowConfigurations
Dim objWinConfig As WindowConfiguration
colWinConfig = dte.WindowConfigurations
objWinConfig = colWinConfig.Item(2)
' List the current window configuration, then set it to another
' one.
MsgBox("Current active window configuration: " & _
colWinConfig.ActiveConfigurationName)
objWinConfig.Apply()
MsgBox("Current active window configuration: " & _
colWinConfig.ActiveConfigurationName)
End Sub
void ApplyExample(_DTE dte)
{
// Set references to all necessary objects.
WindowConfigurations colWinConfig;
WindowConfiguration objWinConfig;
colWinConfig = dte.WindowConfigurations;
objWinConfig = colWinConfig.Item(2);
// List the current window configuration, then set it to another
// one.
MessageBox.Show("Current active window configuration: " +
colWinConfig.ActiveConfigurationName);
objWinConfig.Apply(false);
MessageBox.Show("Current active window configuration: " +
colWinConfig.ActiveConfigurationName);
}
You can save your current window layout in the Visual Studio environment as a named window configuration. Use the Item method of the WindowConfigurations collection to navigate to the desired configuration, and then use the Apply method to recall the configuration.