This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2012+

Visual Studio Preview Tab

Visual Studio 2012 includes a number of improvements that can improve developer productivity. One of the simpler tools is the preview tab, which allows the contents of code files to be viewed without opening them for editing.

Code Preview Tab

When working with large projects in Visual Studio you may open a number of files whilst looking for a particular piece of code. If you open several windows before finding what you are looking for, you will probably want to close most of the newly created tabs. Although a simple task, this can be frustrating.

When using Visual Studio 2012, you can avoid this using the new code preview function. Rather than double-clicking files in the Solution Explorer, you can single-click to select them. Once selected, the contents of the file are displayed in a code editor window. If you change the selection, either by clicking another file or using the keyboard to move up and down the list, the preview window updates to show the newly highlighted file. If the selected file is not already open, it is shown in a tab at the right of the tab bar. Open files remain in their current tab, which is brought to the front to make it visible.

The image below shows the code preview in action. The CircularBuffer.cs file has been selected and its contents are visible. Note that the class appears in a tab to the right of the tab bar.

Visual Studio Code Preview Tab

If the file in the preview tab is the one that you wish to work with you can click the code and edit it within the preview. This promotes the preview to a normal editor window, moving the tab to the left and allowing you to preview more files without replacing the contents of the editor. You can also open the previewed file by clicking the small folder glyph that appears within the tab.

12 November 2012