开发者

Automatically changing the toolbars and windows shown in different views in VS 2008

Is there a way to get Visual Studio 2008 to automatically change the the tool windows shown when changing from view t开发者_运维问答o 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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜