Freigeben über


Split Code Windows Vertically

Windows: ALT + W, N (new window); ALT + W, V (new vertical tab group)

Menu: Window | New Window; Window | New Vertical Tab Group

Command: Window.NewWindow; Window.NewVerticalTabGroup

Versions: 2005, 2008, 2010

Code: vstipEnv0063

 

 

For quite some time you have been able to split your code windows horizontally (see https://blogs.msdn.com/b/zainnab/archive/2010/03/05/split-your-windows-vstipenv0004.aspx) but did you know there is a technique you can use to split your code windows vertically?

 

 

Other File Types

These techniques do not work on .ASPX files see https://blogs.msdn.com/b/zainnab/archive/2010/12/05/vertical-split-view-vstipedit0081.aspx

 

Also, these techniques will not work for .XAML files. To split them vertically click the Vertical Split button in the designer:

clip_image002

 

 

 

Vertically Splitting Code Files

First, locate the tab for the file you want to split vertically:

clip_image004

 

 

Next, make a copy of the window by going to Window | New Window on your Menu Bar:

clip_image006

clip_image008

 

 

Finally, go to Window | New Vertical Tab Group to split the copies:

clip_image010

clip_image012

 

 

Now you have the code window split vertically in the IDE. Of course you could always rip one of the copies outside the IDE and vertically arrange them as well (https://blogs.msdn.com/b/zainnab/archive/2010/01/15/free-your-document-windows.aspx).

Comments

  • Anonymous
    June 14, 2011
    Why does this not work for VB?  C# and C++ only?!?

  • Anonymous
    November 29, 2012
    That is pretty useless advice - who needs two copies of the same code file? The point is you then need to open the other file(s) you do want to see in the second tab group, and of course close the duplicate file - in that order otherwise the second tab group disappears. Pretty annoying and badly designed IMHO.

  • Anonymous
    November 30, 2012
    The comment has been removed

  • Anonymous
    March 25, 2013
    Such a convenient and perfect answer. Thanks much.

  • Anonymous
    June 23, 2013
    Perfect, to the point tip, thank you! Paul completely misses the point. This does not create a copy of the file, but opens a second "view". You can then view the same file side-by-side to compare two functions in the same file etc. which on modern days' "wide" monitor formats makes more sense than the built-in "on-top-of-each-other" splitview.

  • Anonymous
    July 29, 2014
    I disagree Paul. Sometimes you are scrolling all the time between 2 functions in the same file, so if you can see them both at the same time (vertically arranged) it's just what you need. Great tip!

  • Anonymous
    August 26, 2014
    Any idea about how to navigate the secondary window to the working windows position? ("Equalize" what code is being viewed in the to panes.) Say you want to "peek definition" via the real F12 and not Alt-F12, but don't want to loose your working position.

  • Anonymous
    December 16, 2014
    Can anyone tell me how can one divide the screen to see two different results of the code?

  • Anonymous
    February 23, 2015
    This is a good feature. But when I restart visual studio 2010 (or open it the next day..) my vertical tabs become HORIZONTAL (which I don't like). Is this a feature or bug and how to solve this?

  • Anonymous
    March 10, 2015
    It's a nice start, but it's also half useless without sharing keyboard shortcuts on how to swap between the two views. Sara, from what i understand of your question, this entire post was an answer to your question. Either you didn't understand the article or i am totally missing what you are asking. I'm guessing it's more likely that i don't understand what you are asking, but i share this in case others might have the same problem understanding your question.

  • Anonymous
    July 13, 2015
    Humilulo, if by "swapping between two views" you mean changing a focus from one opened file to another then "Ctrl + Tab" and "Ctrl + Shift + Tab" do the job.