如何使Visual Studio在编程和调试时使用相同的GUI布局?[英] How do I make Visual Studio use the GUI same layout while programming and while debugging?

本文是小编为大家收集整理的关于如何使Visual Studio在编程和调试时使用相同的GUI布局?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

Visual Studio使用两个不同的GUI布局,具体取决于您的代码是否正在运行.我了解此目的(让您实际上调试时只显示与调试相关的窗口),但是我发现此功能很烦人,并且在调试而不是在调试时更喜欢使用相同的布局.

是否可以禁用此功能,如果是的话,如何?

推荐答案

有趣的时机. Zain Naboulsi刚刚在 Visual Studio Tip and Tricks Blog :

  1. 窗口布局:四个模式
  2. 窗口布局:设计,调试和全屏
  3. 窗口布局:文件查看

这里要记住的是, 两者,您的工具窗口和您的 保存命令栏自定义 分别适用于每个状态.有 无法告诉视觉工作室使用 目前所有模式的一种状态. 另外,当您关闭 视觉工作室在任何状态,这四个状态 状态被保存.

编辑

免责声明:我没有自己尝试过,但是看起来很有希望.如果您导出了Visual Studio设置并使用文本编辑器编辑结果文件,则可以找到<Category name="Environment_WindowLayout"> element每个布局都有子元素.我猜想将<Design>复制到<Debug>中会导致两个布局相同.也许有人可以编写VS加载项或外部实用程序来自动化此:)

这简化了相关设置XML布局的样子:

<UserSettings>
    <Category name="Environment_Group" ...>
        <Category name="Environment_WindowLayout" ...>
            <NoToolWin>
                ...
            </NoToolWin>
            <Design>
                ... 
            </Design>
            <Debug>
                ...
            </Debug>
            <Design-FullScreen>
                ...
            </Design-FullScreen>
        </Category>
    </Category>
</UserSettings>
据我所知,

其他推荐答案

无法改变这种行为.但是,我要做的是将它们都设置为相同(两次设置窗口;在编写代码和调试时一次一次),并且外观不会发生变化.

本文地址:https://www.itbaoku.cn/post/1875732.html

问题描述

Visual Studio uses two different GUI layouts depending on whether or not your code is running. I understand the purpose of this (letting you only show debugging-related windows while you're actually debugging) but I find this feature annoying and would prefer the same layout be used while both debugging and not.

Is it possible to disable this feature and, if so, how?

推荐答案

Interesting timing. Zain Naboulsi just wrote a few posts about this in the Visual Studio Tip and Tricks blog:

  1. Window Layouts: The Four Modes
  2. Window Layouts: Design, Debug, and Full Screen
  3. Window Layouts: File View

The thing to remember here is that, both, your tool windows and your command bar customizations are saved separately for each state. There is no way to tell Visual Studio to use one state for all modes at this time. Additionally, when you shut down Visual Studio in any state, all four states are saved.

EDIT

Disclaimer: I haven't tried this myself, but it look promising. If you export your Visual Studio settings and edit the resulting file with a text editor, you can find a <Category name="Environment_WindowLayout"> element with child elements for each layout. I would guess that copying <Design> into the <Debug> would result in both layouts being identical. Maybe someone can write a VS add-in or external utility to automate this :)

Here is a simplification of what the relevant settings XML layout looks like:

<UserSettings>
    <Category name="Environment_Group" ...>
        <Category name="Environment_WindowLayout" ...>
            <NoToolWin>
                ...
            </NoToolWin>
            <Design>
                ... 
            </Design>
            <Debug>
                ...
            </Debug>
            <Design-FullScreen>
                ...
            </Design-FullScreen>
        </Category>
    </Category>
</UserSettings>

其他推荐答案

As far as I know, there is no way to change this behavior. However, what I do is set them both up to be the same (set up the windows twice; once while writing code and once while debugging) and there will be no change in appearance.