Visual Studio 中的拆分编辑窗口

发布于 2024-07-08 07:31:53 字数 74 浏览 5 评论 0原文

有没有办法在 Visual Studio 中显示两个编辑窗口?

我想同时查看两个源文件,但我找不到执行此操作的选项。

Is there any way to show two editing windows in Visual Studio?

I would like to look at two source files at the same time, but I cannot find the option to do that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

超可爱的懒熊 2024-07-15 07:31:54

在 Visual Studio Community 2019 中,要分割一个文档(代码)并拥有两个独立的代码视图,显示的右上角有一个小工具:

在此处输入图像描述

只需将其拖下来,您就会得到当前文件的另一个查看器。 要调整高度,您可以抓住两个视图之间的栏并拖动。 (可能有点棘手,只需移动鼠标,直到鼠标指针图标变为双箭头)

要在两个文件之间拆分视图,只需右键单击其中一个文件选项卡(标题),然后在出现的菜单中您可以选择“新水平文档组或新垂直文档组:

在此处输入图像描述

In Visual Studio Community 2019 to split a document (code) and have two independent views of the code, there is a little tool in the top right corner of the display:

enter image description here

Just drag it down and you will get another viewer for the current file. To adjust the height you can grab the bar between the two views and drag. (Can be kinda tricky, just move your mouse until the mouse pointer icon changes to double arrows)

To split the view between two files just right-click on one of the files tabs (title) then in the resulting menu you can select either "New Horizontal Document Group, or New Vertical Document Group:

enter image description here

遗弃M 2024-07-15 07:31:54

要为“Window->New Vertical Tab Group”创建键盘快捷键,您需要为“Window.NewVerticalTabGroup”命令分配快捷键。
工具->选项->环境->键盘,在“显示包含的命令”中键入“Window.NewVerticalTabGroup”,并在“按下快捷键”字段中指定键盘快捷键。
请记住在“确定”之前单击“分配”。

To create a keyboard shortcut for "Window->New Vertical Tab Group" you need to assign a shortcut to "Window.NewVerticalTabGroup" command.
Tools->Options->Environment->Keyboard, in "Show commands containing" type "Window.NewVerticalTabGroup", and assign the keyboard shortuct in "Press shortcut keys" field.
Remember to click "Assign" before "OK".

笑咖 2024-07-15 07:31:54

对于 Visual Studio 2012:

将鼠标移至“类”选项卡 > 右键单击班级标题> 新水平选项卡组或新垂直选项卡组。

如果要拆分同一个类:工具-> 选项-> 环境-> 键盘-> 通过 Window.Split 搜索并添加新的快捷方式。

For Visual Studio 2012:

Move your mouse over the Class tab > Right Click on the Title of the Class > New Horizontal Tab Group or New Vertical Tab Group.

If you want to split the same class: Tools -> Options -> Environment -> Keyboard -> search by Window.Split and add a new shortcut.

分開簡單 2024-07-15 07:31:54

在 Visual Studio 2022 中。

要并排编辑同一文件(垂直分割编辑窗口)而不实际创建文件的新副本,您可以:

  • 选择文件( tab)进行拆分。
  • 选择窗口”-> 菜单中的“新窗口”。
    窗口 - > 新窗口
    所选文件(选项卡)分为两个文件(选项卡),以 :1 和 :2 结尾。
    这是同一个文件,而不是第一个文件的副本。
  • 右键单击其中一个文件并选择“新建垂直文档” Group”将编辑窗口分成两部分。
    新垂直文档组

In Visual Studio 2022.

To edit the same file side by side (vertically split the editing window) without actually making a new copy of the file, you:

  • Select the file (tab) to split.
  • Choose "Window" -> "New Window" from the menu.
    Window -> New Window
    The selected file (tab) is split in to two files (tabs), ending with :1 and :2.
    It's the same file, NOT a copy of the first file.
  • Right click on one of the files and select "New Vertical Document Group" to split the editing window into two parts.
    New Vertical Document Group
南冥有猫 2024-07-15 07:31:54

在 Visual Studio 2015 中:

右键单击(文件名)选项卡,然后选择垂直拆分或水平拆分。

In Visual Studio 2015:

Right click on the (file name) tab and select vertical split or horizontal split.

在较新的 Visual Studio 版本中(我可以在 Visual Studio 2017 15.9.55 及更高版本中确认这一点),您可以执行以下操作: Window -> 分裂。 您也可以按照相同的方式取消拆分。 这适用于当前活动选项卡。

In newer Visual Studio versions (I can confirm this for Visual Studio 2017 15.9.55 and newer versions), you can do: Window -> Split. You can also unsplit following the same way. This will work so for the current active tab.

小傻瓜 2024-07-15 07:31:54

您可以使用我的 Task Canvas 扩展同时查看多个源文件:

在此处输入图像描述

You can use my Task Canvas extension to look at several source files at the same time:

enter image description here

〆凄凉。 2024-07-15 07:31:54

我知道这个答案有点无关,但我来这里是因为我试图用同一个窗口进行分割。 如果您像我一样尝试这样做,只需转到 Window > 分割

在此处输入图像描述

I know this answer is a little unrelated, but I came here because I was trying to a split with the same window. In case you're like me trying to do this, just go to Window > Split

enter image description here

深者入戏 2024-07-15 07:31:53

我认为您想要做的是添加一个新的垂直选项卡组。 执行此操作的键盘快捷键是

Alt + WV

根据此,它适用于 Visual Studio 2005 、2008 年和 2010 年。根据我的经验,它也适用于 Visual Studio 2013。

I think what you want to do is to add a new vertical tab group. The keyboard shortcut to do that is

Alt + W, V.

According to this source, it works for Visual Studio 2005, 2008, and 2010. In my experience, it also works for Visual Studio 2013.

仄言 2024-07-15 07:31:53

另一个简单的选择是打开两个文档,然后只需单击并拖动其中一个文档的选项卡并将其放在文档本身上。 这将显示一个菜单,可让您将文档移动到新的垂直或水平选项卡组。

我发现这是最简单、最快的方法。

您没有在问题中询问,但如果您想在两个窗口中编辑一个文档,您可以抓住滚动条上方的小区域并将其向下拖动。 您现在将在两个可滚动区域中打开文档。 非常适合同时处理两个部分。

Another easy option is to open two documents, then just click and drag the tab for one of the documents and drop it on the document itself. This will display a menu that lets you move the document to a new vertical or horizontal tab group.

I find this to be the easiest and quickest way to do this.

You didn't ask in the question, but if you want to edit one document in two windows, you can grab the small area above the scrollbar and drag it down. You will now have your document open in two scrollable areas. Great for working on two sections at once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文