Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: How can I see the same file in two separate tab groups?

People also ask

How do I open multiple tabs in Visual Studio?

Double-click the files you want to open in a new tab. Double-click on the files you want to open in the new tab.

How do I see all open tabs in Visual Studio?

After installing, select [View] -> [Other Windows] -> [Working Files List] on the menu bar within Visual Studio. Any open documents should be listed in the tool window. Left-clicking on an item in the list activates the tab for that document. Middle-clicking on an item closes that file.


You can open the file in another tab (Window -> New Window).

Doing so you have two copies of the same file. Then you can right-click the tab bar and select New Vertical Tab Group (or New Horizontal Tab Group, the one you like more).

Hope I understood you question..


Only vertically that I'm aware. When looking at the code, right above the vertical scroll bar is a small rectangle, drag it down to get a split view of the file.


Be on the tab you want to duplicate,
then click in the menu bar at the top on
Window > New Window

Finally drag & drop the second window to the the left or right side to show both views next to each other.
Et voila, there you have it :)

image insturction 1image insturction 2

EDIT

It seems that this function is not implemented in all version of VS.
In my case (V 15.4.2 (2017), V 15.9.7 (2017) & V 16.2.5 (2019)) it just works fine.

Version 15.9.7


You simply use the small drag arrows icon at the top right corner of your file window as depicted in the following screenshots:

Before dragging

After dragging


1) View the same document side-by-side (with a fix for Visual Studio 2017)

It is possible to do this using New Window and New Vertical Tab Group, however, in my Visual Studio 2017 the New Window command was missing from the Window menu. To use it, first you must add the command to a menu or assign a shortcut to it.

To add New Window to your Window menu follow this sequence, starting with the Tools menu:

Tools > Customize > Commands > Menu Bar > Window > Add Command > Window > New Window

FYI In the Commands step you decide where to put the New Window command. The sequence I gave above puts it unceremoniously at the top of the Window menu.

To view the same document side-by-side

  1. Open the document you want to view side-by-side
  2. Select your recently added New Window command (perhaps it's in Window > New Window)
  3. Right click the new tab and select New Vertical Tab Group or select that command from the Window menu

2) View the same document above-one-another

If you wish to view the same document in two views on top of each other use the Window > Split command or click-and-drag the double-arrow at the top of the scroll bar for any window.

3) Get creative

FYI You can even combine the two view options to have three, four or even more views of the same document on a particularly wide monitor. On mine (2560 x 1080) I can comfortably get three side-by-side views going and split them vertically, if desired. multiple panes