VisualStudio2010烦人地在错误的 MDI 窗格中打开文档

Visual Studio 的 MDI 现在让我很沮丧,下面是我的基本布局:

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

非常标准-我在区域1中打开文件,在区域2中打开错误窗口,在区域3中打开解决方案浏览器。

我感到沮丧的主要原因是,当我双击从解决方案资源管理器打开一个文件时,它通常会在应该打开的区域1打开,但有时(似乎是随机的)它会在区域2打开,这意味着我必须将它拖到区域1才能正确地看到它。或者,更罕见的是,它甚至可能在区域1和3之间的一个全新窗格中打开。

此外,如果我关闭所有的文件,区域2将扩展到占据整个左栏,并且新的文件将在这个新的合并窗格中打开,这同样是令人恼火的。或者,他们也许不会,这取决于今天的心情。

在我们20人的办公室里,似乎没有其他人有这个问题,但同样地,似乎也没有人知道如何解决这个问题。所以:

  1. 我想让它使我打开的文件总是打开到区域1。
  2. 我想知道是否有可能能够“锁定”我的布局(例如,我可以与 Windows 任务栏) ,以防止我意外移动或调整大小窗格。
19791 次浏览

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.

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.

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.

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.

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!