Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 annoyingly opens documents in wrong MDI pane

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.
like image 727
Mike Chamberlain Avatar asked Dec 16 '10 03:12

Mike Chamberlain


2 Answers

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.
like image 51
Josh Avatar answered Sep 20 '22 09:09

Josh


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.

like image 35
kalmiya Avatar answered Sep 19 '22 09:09

kalmiya