Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Public Module Accessibility Dim showToolWindows As Integer = -1 Dim openedWindows As System.Collections.Specialized.StringCollection Public Sub MyToggleToolWindows() If (showToolWindows = 1) Then showToolWindows = 0 openedWindows = New System.Collections.Specialized.StringCollection ElseIf (showToolWindows = 0) Then showToolWindows = 1 Else ' by default set to 1 showToolWindows = 1 For Each window As Window In DTE.Windows ' Check that this is a tool window and not a document window. If (window.Document Is Nothing) Then If (window.Visible) Then showToolWindows = 0 End If End If Next End If For Each window As Window In DTE.Windows ' Check that this is a tool window and not a document window. If (window.Document Is Nothing) Then If (showToolWindows) Then ' hide window. Try If (openedWindows.Contains(window.Caption)) Then window.Visible = True End If Catch exception As Exception End Try Else ' hide window. Try If (window.Visible) Then openedWindows.Add(window.Caption) window.Visible = False End If Catch exception As Exception End Try End If End If Next End Sub End Module