ProvideToolWindowVisibilityAttribute Class


Maps a tool window to one or more UI contexts, so that the window is displayed when the user switches to one of those contexts and is hidden when the user switches away from one of the contexts.

public ref class ProvideToolWindowVisibilityAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class ProvideToolWindowVisibilityAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideToolWindowVisibilityAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
type ProvideToolWindowVisibilityAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class ProvideToolWindowVisibilityAttribute
Inherits RegistrationAttribute


Applying this attribute to a subclass of the ToolWindowPane results in a tool window that the Visual Studio shell automatically shows or hides. The appearance of this window depends on the internal visibility attribute and the UI context information described in the package's .vsct file. If Visual Studio automatically shows a window and the user closes it, after that Visual Studio will never automatically show the window again. In order to see the tool window again after it has been closed, the user must manually open the window or delete \<USER>\Application Data\Microsoft\Visual Studio\<version>\1033\windows.prf, the Visual Studio file that saves shell information (including which windows are open, their location and size) when Visual Studio shuts down. After the window's internal visibility state is reset to true, the expected visibility behavior again occurs.


ProvideToolWindowVisibilityAttribute(Object, String)

Initializes a new instance of ProvideToolWindowVisibilityAttribute for the specified type of the tool window and a GUID to associate with its visibility.



Gets the GUID of a command associated with showing or hiding the tool window.


Gets or sets the name of the window.


Override the TypeID property in order to let the RegistrationAttribute derived classes to work with System.ComponentModel.TypeDescriptor.GetAttributes(...). An attribute derived from this one will have to override this property only if it needs a better control on the instances that can be applied to a class.

(Inherited from RegistrationAttribute)



Gets the registry path (relative to the registry root of the application) of the VSPackage.

(Inherited from RegistrationAttribute)

Registers the tool window visibility.


Removes the registry key.

Applies to