简体   繁体   English

在Visual Studio 2015中更改解决方案资源管理器工具窗口的标题

[英]Changing the title of the Solution Explorer tool window in visual studio 2015

In visual studio, in the Solution Explorer you can right clock and select "New Solution Explorer from here" 在Visual Studio中,您可以在解决方案资源管理器中进行计时,然后选择“从这里开始新的解决方案资源管理器” 在此处输入图片说明 Then a new Solution explorer tool window open - but it has the same name "Solution Explorer" - and no way to reflect the folder it represents or anything. 然后将打开一个新的解决方案资源管理器工具窗口-但其名称为“ Solution Explorer”-无法反映其代表的文件夹或其他内容。

If I want to use multiple solution explorer windows - it'll be best if I can determine a name for them - or if their name would be representative of the root item they refer to. 如果要使用多个解决方案资源管理器窗口-最好为它们确定一个名称-或者它们的名称代表它们所引用的根项目。

Is there a visual studio extension that does that? 是否有Visual Studio扩展程序可以做到这一点?

You can the title value via the property named caption. 您可以通过名为标题的属性来获得标题值。 Here is a simple demo for your reference. 这是一个简单的演示供您参考。

 DTE2 dte = (DTE2)this.ServiceProvider.GetService(typeof(DTE));
            List<Window> list = new List<Window>();
            foreach (Window w in dte.Windows)
            {
                if (w.Caption == "Solution Explorer")
                {
                    list.Add(w);
                }
            }

            for (int i = 0; i < list.Count; i++)
            {
                list[i].Caption = "Test" + i;
            }

在此处输入图片说明

您还可以如下所示直接获取解决方案资源管理器窗口并更新名称:

(dte.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer)).Caption = "Foo"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2015解决方案资源管理器不刷新文件? - Visual studio 2015 solution explorer doesn't refresh files? Visual Studio 2015项目存在,但不再显示在解决方案资源管理器中 - Visual Studio 2015 Project exists but no longer shown in Solution Explorer Visual Studio 2015解决方案资源管理器树视图中缺少文件图标 - File Icons are missing in Visual Studio 2015 Solution Explorer Tree View Visual Studio 2015 - 缺少解决方案资源管理器分支中的内容 - Visual Studio 2015 - missing content in solution explorer branches 什么是Visual Studio 2015命令以显示Team Explorer Build窗口 - What is the Visual Studio 2015 command to display the Team Explorer Build window Visual Studio 2015:Git Diff工具窗口为空 - Visual Studio 2015: Git Diff Tool Window is empty Visual Studio 2015没有构建解决方案 - Visual Studio 2015 not building solution 在 Visual Studio 2015 中重新加载项目后如何保留“新的解决方案资源管理器视图”? - How to keep “new solution explorer views” after reload a project in Visual Studio 2015? Visual Studio 2015中的解决方案资源管理器菜单缺少jspm软件包和config.js - Solution explorer menu in Visual Studio 2015 is missing jspm packages and config.js bower.json未在Visual Studio 2015解决方案资源管理器中显示 - bower.json doesn't show in Visual Studio 2015 solution explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM