Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Properties/Toolbox Pane when not in Resource View?

Every time I view a form or dialog in Visual Studio (2005) the Properties and Toolbox panes show up on the right side of my screen. That's good to have because they are useful for manipulating dialogs.

However once I switch back to source code these panes just get in the way... is there a way to get them to go away automatically?

like image 785
theycallmemorty Avatar asked Jul 16 '09 19:07

theycallmemorty


People also ask

How do I show the properties panel in Visual Studio?

You can find Properties Window on the View menu. You can also open it by pressing F4 or by typing Properties in the search box. The Properties window displays different types of editing fields, depending on the needs of a particular property.

How do I pin a Toolbox in Visual Studio?

You can pin Toolbox (by clicking the Pin icon on its toolbar) so that it remains open when you move the cursor. You can also undock the Toolbox window and drag it anywhere on your screen.

Where is properties in VS code?

To open the Settings editor, use the following VS Code menu command: On Windows/Linux - File > Preferences > Settings. On macOS - Code > Preferences > Settings.

What is the Properties window in Visual Basic?

The Properties window is used to display properties for objects selected in the two main types of windows available in the Visual Studio integrated development environment (IDE). These two types of windows are: Tool windows such as Solution Explorer, Class View, and Object browser.


1 Answers

I've done something recently in VS2010 using a macro that shows and hides the Tools panel when switching back and forth from code to design view in asp.net MVC3 views. It could be easily adapted to do the same for your situation I think.

This goes in the EnvironmentEvents class file in in the VS Macro IDE after the pre-generated content.

<System.ContextStaticAttribute()> Public WithEvents CommandEvents As EnvDTE.CommandEvents


  Public Sub DTEEvents_OnMacrosRuntimeReset() Handles _
  DTEEvents.OnMacrosRuntimeReset
        CommandEvents = DTE.Events.CommandEvents
    End Sub

    Private Sub DTEEvents_OnStartupComplete() Handles _
        DTEEvents.OnStartupComplete
        CommandEvents = DTE.Events.CommandEvents
    End Sub

    Public Sub CommandEvents_AfterExecute( _
    ByVal Guid As String, _
    ByVal ID As Integer, _
    ByVal CustomIn As Object, _
    ByVal CustomOut As Object) _
    Handles CommandEvents.AfterExecute

        If DTE.Commands.Item(Guid, ID).Name = "View.ViewDesigner" Then
            DTE.ExecuteCommand("View.Toolbox")
        End If

        If DTE.Commands.Item(Guid, ID).Name = "View.ViewMarkup" Then
            DTE.Windows.Item(Constants.vsWindowKindToolbox).Close()
        End If

    End Sub

It could probably be better optimized using the guids of the event rather than the if statements. It works when you use the hot keys for switching views as well as the view menu, but not the context menu.

like image 79
Graham Conzett Avatar answered Sep 28 '22 09:09

Graham Conzett