visual-studio 如何让代码窗口在 Visual Studio 2008 中垂直拆分?(不是 HTML 模式)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/672110/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 10:18:08  来源:igfitidea点击:

How do I get a code window to split vertically in Visual Studio 2008? (not HTML mode)

visual-studiovisual-studio-2008ide

提问by Blorgbeard is out

In Visual Studio 2008, it seems that Window -> Splitonly gives me a horizontal split, and Window -> New horizontal tab groupdoes not allow me to edit the same file in both panes.

在 Visual Studio 2008 中,似乎Window -> Split只给了我一个水平拆分,而Window -> New水平选项卡组不允许我在两个窗格中编辑同一个文件。

Note that I am talking about C# code windows, notHTML editing mode.

请注意,我说的是 C# 代码窗口,而不是HTML 编辑模式。

I want to edit the same file in two horizontally arranged panes.

我想在两个水平排列的窗格中编辑同一个文件。

Is this possible? Free add-ons are fine.

这可能吗?免费附加组件很好。

Edit:I have CodeRush Express installed, and it seems to have done somethingto my code window borders.

编辑:我安装了 CodeRush Express,它似乎对我的代码窗口边框做了一些事情

Edit #2:It's not CodeRush. I tried on VM with no CodeRush, and I have exactly the same issue.

编辑 #2:它不是 CodeRush。我在没有 CodeRush 的 VM 上尝试过,我遇到了完全相同的问题。

回答by Blorgbeard is out

Ok, I found the solution here.

好的,我在这里找到了解决方案。

The answer is:

答案是:

  1. Window -> New Window
  2. Window -> New Vertical Tab Group
  1. 窗口 -> 新窗口
  2. 窗口 -> 新建垂直选项卡组

This duplicates the current tab so you'll get [Form1.cs:1]and [Form1.cs:2]tabs; and thenyou can use a vertical tab group to view them side by side.

这将复制当前选项卡,因此您将获得[Form1.cs:1][Form1.cs:2]选项卡;并且然后你可以使用垂直选项卡组并排查看他们身边。

回答by Eclipse

I believe that it's not CodeRush's fault. A vanilla 2008 install only lets you do the split view with one file on the top and one file on the bottom. The only side-by side option is the horizontal tab-group feature (with the problem of only having a file open in one of them, as you mentioned.)

我相信这不是 CodeRush 的错。vanilla 2008 安装仅允许您在顶部一个文件和底部一个文件的情况下进行拆分视图。唯一的并排选项是水平选项卡组功能(正如您提到的,问题是只能在其中之一中打开文件。)

The obvious workarounds would be to either make a read-only copy of the file elsewhere and use that in one tab-group, or open up a second instance of VS. It does have decent handling of files that get changed in other apps, so having the same file open in two instances isn't a problem.

显而易见的解决方法是在别处制作文件的只读副本并在一个选项卡组中使用它,或者打开 VS 的第二个实例。它确实可以很好地处理在其他应用程序中更改的文件,因此在两个实例中打开相同的文件不是问题。

回答by Chris

In VS2010 I couldn't find the Vertical Tab group button. The workaround is:

在 VS2010 中,我找不到 Vertical Tab 组按钮。解决方法是:

1. Open Fullscreen mode
2. Click and drag the window to the far right (or left) and it should give  
   you an option to view both windows side by side.
3. Exit full screen mode and you should now have the ability to click and  
     drag windows between vertical tab groups, and it even now allows you to  
     drag to a new vertical tab group.

No idea why you have to jump into fullscreen first, and i seem to remember not having to do that before.

不知道为什么你必须先跳到全屏,我似乎记得以前不必这样做。

回答by Dustin Campbell

As a one-time developer on CodeRush, I doubt that this would be caused by CodeRush Xpress. I'm currently running the latest beta of CodeRush 9.1.0 on Visual Studio 2008, and splits are working fine. However, you could certainly try uninstalling CodeRush Xpress to see if that clears up the problem. If it does, I would recommend posting in DevExpress' peer-to-peer forums.

作为 CodeRush 的一次性开发人员,我怀疑这会是 CodeRush Xpress 造成的。我目前正在 Visual Studio 2008 上运行 CodeRush 9.1.0 的最新测试版,并且拆分工作正常。但是,您当然可以尝试卸载 CodeRush Xpress 以查看是否可以解决问题。如果是这样,我建议在 DevExpress 的点对点论坛上发帖。

alt text http://diditwith.net/content_images/CRXSplits.png

替代文字 http://deditwith.net/content_images/CRXSplits.png

回答by Dustin Campbell

I like the vertical tab group option. The only thing that bothers me about it is that I cannot put the solution explorer on both windows (Or properties for that matter). I have to navigate all on one side and move screens around.

我喜欢垂直标签组选项。唯一困扰我的是我无法将解决方案资源管理器放在两个窗口(或与此相关的属性)上。我必须在一侧导航并移动屏幕。

回答by Alverto

I found this nifty add on tool for VS 2012 that allows you to compare two files at the same time and make changes.

我发现这个用于 VS 2012 的漂亮附加工具允许您同时比较两个文件并进行更改。

Check thisout:

看看这个