views:

15

answers:

2

I often run tests and need the test-result pane to be pinned. In other time, I mostly work with writting codes and compile - I prefer to have the output pane (which shared the same space with test-result pane) automatically viewed while compiling and collapsed when done (i.e. unpinned).

I need an hotkey to quickly switch the pane to pinned/unpinned state. How can I do that?

+3  A: 

Take a look at http://netrsc.blogspot.com/2010/04/visual-studio-2010-keyboard-shortcuts.html. For example:

  1. select the Output windows with CTRL+ALT+O
  2. pin the Output with ALT+W+K
  3. auto hide the Output with ALT+W+A
nithins
+2  A: 

You can locate the commands in the options dialog (Tools -> Options -> Keyboard), and assign whatever keyboard shortcut you want for this. However, in your case it's two commands for "pinning" and two for "unpinning". Another option would be to write a macro that does combines the commands:

Sub DockOutputWindow()
    DTE.ExecuteCommand("View.Output")
    DTE.ExecuteCommand("Window.Dock")
End Sub

Sub AutoHideOutputWindow()
    DTE.ExecuteCommand("View.Output")
    DTE.ExecuteCommand("Window.AutoHide")
End Sub

Then you can use the keyboard options to assign shortcut keys to these macros.

Of course you can do this more advanced. Say you have the command "SetCodingMode" that will both dock the output windows and hide the test-result window and "SetTestMode" that does the opposite.

Fredrik Mörk