views:

26

answers:

1

Is there a way to get Visual Studio 2008 to automatically change the the tool windows shown when changing from view to view?

Say i'm in the Code view, i may want the Solution Explorer and the Class View windows, but not the properties window. When i switch to Design view, i don't want the Solution Explorer or the Class view, but i want the Properties to come up. Can visual studio change these things for me instead of me doing it manually everytime i switch a view?

It seems like it would be an easy thing to know whether this feature exists or not, but i haven't been able to find anything about it. Maybe i'm using the wrong terminology.

A: 

Thanks to Hans for pointing me towards macros in his comment, and to pettys answer in this question i came up with a solution. The bulk of it is based off pettys' code but i added an event handler for the WindowActivated event where i decided what view i should load.

Private Sub WindowEvents_WindowActivated(ByVal GotFocus As EnvDTE.Window, ByVal LostFocus As EnvDTE.Window) Handles WindowEvents.WindowActivated
    If GotFocus.Kind = "Document" Then
        If GotFocus.Caption.Contains("[Design]") Then
            LoadDesignView()
        Else
            LoadCodeView()
        End If
    End If
End Sub
David A.