104

Visual Studio's MDI is currently causing me a lot of frustration. Here is my basic layout:

+--------------+---+
|              |   |
|      1       |   |
|              |   |
|              | 3 |
+--------------+   |
|      2       |   |
+--------------+---+

Pretty standard - I have my open files in area 1, my errors window in area 2, and my solution explorer in area 3.

The main source of my frustration is that when I double click to open a file from the solution explorer, it will usually open in area 1 where it should, but SOMETIMES (seemingly at random) it will open in area 2, meaning I have to drag it up to area 1 to see it properly. Or, more rarely, it might even open in a completely new pane between areas 1 and 3.

Further, if I close all my files, area 2 will expand to take up the whole left column, and new files will open in this new combined pane, which again is annoying. Or, they maybe not, depending on what mood VS is in today.

No one else in our office of 20 seems to have this problem, but similarly no one seems to know how to fix it. So:

  1. I want to make it so files I open always open into area 1.
  2. I wonder if it is possible to be able to "lock" my layout (eg. like I can with the Windows Task Bar), to stop me from accidentally moving or resizing panes.
Mike Chamberlain
  • 39,692
  • 27
  • 110
  • 158
  • I will comment that now, a few weeks later, I no longer have this problem, and all documents are opening in the right place. Perhaps Josh's suggestion below did indeed help (so +1 for him), though it didn't seem to fix the problem immediately. So I am still unsure as to what the real solution is. :S – Mike Chamberlain Jan 09 '11 at 22:50
  • When I had the same problem I noticed that the tabs for my output/error windows were on the top of the MDI window. My issue was in Atmel Studio which is based on Visual Studio, it was also fixed by following Josh's steps below. – James Nov 28 '12 at 06:20

5 Answers5

189

Did you perhaps use the "New Horizontal Tab Group" command to split #1 into #1 and #2, then move your errors window into that?

I would just try resetting the window layout and see if that fixes it.

  1. First, Window -> Close All Documents
  2. Then, Window -> Reset Window Layout
  3. Exit VS to be sure, then go back in.
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
Josh
  • 68,005
  • 14
  • 144
  • 156
  • 4
    I'd give +5 if I could. This happened to me after installing Telerik JustCode, which messed up the window layout. Thanks! – Richard Oct 05 '12 at 09:32
  • 4
    Problem still occurs in VS2013 and can be solved by doing the steps above. Great! – Andreas Oct 23 '15 at 07:28
  • 5
    Problem still occurs in VS2015 and can be solved by doing the steps above. Great! – tzachs Mar 30 '16 at 14:08
  • Life saver! Note that if bullet 3 is not executed, files can still be opened in 'the wrong tab well'. Exiting and starting VS solved this for me. – Michel van Engelen Jan 06 '17 at 08:27
  • 1
    This works when it works, but sometimes it does nothing - even in VS2017. How can nobody figure out how to fix this? – Simon_Weaver May 25 '17 at 06:33
18

Another solution - avoiding "Reset Layout" - is to reposition the windows in "area 2" (usually breakpoints/watch/debug-output) making sure you drag them to the circled "bottom-most" of the dockpositions (if you move it to the one crossed out in the below image, it'll open code-files in the wrong location).

visual studio window docking locations

Alternatively, at the very bottom of the screen there is another dock-position, but that one will cause area #2 to be stretched through the entire bottom of the screen (stealing some space from area #3).

Fix is instant & no need to restart Visual Studio.

kalmiya
  • 2,988
  • 30
  • 38
  • This fixed my issue. I don't know what caused everything to go into the wrong pane right above it. – Rick Paul Feb 24 '18 at 03:04
  • It usually happens to me when I want to enlarge the debug-output window, but accidentally click in the wrong position and instead drag the output-window out of the docked position. Then when re-docking it doesn't seem to matter which of the above you select (windows moves back to place) but if you took the crossed-out one - the code windows start opening in the "wrong" location. Took me quite a while before I made that connection :) – kalmiya Feb 24 '18 at 10:15
7

I have this problem too.

I tried Josh's solution, and it worked. Actually it might be even simpler, it might be enough to just do Window -> Reset Window layout. But I can't test that since I don't know how the wrong behaviour started.

If Josh's solution does not work for you, someone at Microsoft support recommended to reset all settings ( Tools-> Import and Export setting... -> Reset all settings (see http://connect.microsoft.com/VisualStudio/feedback/details/635796/files-open-up-in-the-wrong-docking-window).

I did not want to do that because I didn't want to use all my settings - and it turned out to not be necessary.

Torben Junker Kjær
  • 4,042
  • 4
  • 34
  • 33
  • I can confirm that Josh Einstein's solution above works (close all windows, reset window layout, restart VS), whereas the simpler solution suggested by huttelihut (just resetting the window layout) did not work for me. – bjull Feb 03 '12 at 09:42
  • I tried this one first, and it worked! (VS Express 2013 for Web) – Sphinxxx Apr 10 '16 at 16:26
  • I agree that this works to fix the problem of which pane is used when opening a file, but in my case (VS 2019), it closed pane #2 altogether, which was a pain (pun intended). – Tom Bogle Apr 22 '20 at 16:02
2

I had the same problem with Visual Studio. Plus my explorer window kept disappearing all the time and had to go to view and launch both properties and explorer window again.

Solution:

  1. Go to Window Then Reset layout.
  2. Organize your workstation the way you want as far as properties, toolbar/toolbox and explorer window.
  3. Go back to window Then save Layout.

This will allow you to go back to the layout that you prefer every time things move around. Hope this helps. Happy coding.

techspider
  • 3,370
  • 13
  • 37
  • 61
0

I had the same problem with Visual Studio 2019.

The confirm, the solution that worked for me was to follow both Josh's answer and kalmiya's answer:

  1. Window -> Close All Documents
  2. Window -> Reset Window Layout
  3. Press Ctrl + Shift + F, to find some text in your solution
  4. Drag the 'Find window' to the bottom-most dock position (see diagram in kalmiya's answer)
  5. Restart Visual Studio

If you want to reproduce the problem, simply drag the 'Find window' to the second-from-bottom dock position.

Many thanks for the previous answers!

Jimmy F
  • 1
  • 1