c# - 使用扩展包时如何修改SSMS(18)中的状态栏和标题背景颜色?
问题描述
我创建了一个扩展包项目,当文档打开时,我想在使用不同的 sql 连接时修改文档颜色。
我只能获得 DTE 和 WindowActivated 事件。
dte = Package.GetGlobalService(typeof(DTE)) as EnvDTE80.DTE2;
dte.Events.WindowEvents.WindowActivated += OnWindowCreated;
我想得到这个结果: 结果
解决方案
在我们的应用程序中,我们设置了类似这样的颜色
IVsWindowFrame frame;
frame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out object docView);
var strip = GetPrivateMember<System.Windows.Forms.StatusStrip>(docView, "statusBar");
strip.BackColor = _your_color_;
IVsWindowFrame
例如,您可以通过这种方式获得 - 您可以IVsRunningDocTableEvents3
在此方法中为您的文档创建实现并存储框架
public int OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame)
推荐阅读
- c# - EventLogQuery 忽略 TimeCreated 条件
- javascript - 在 Vue 中使用从 Asp Controller 发送的对象
- javascript - 在测试 React 组件 onClick 时监视功能检查
- python - 在 Pandas 数据框中保留空值
- python - Pandas countif 基于多个条件,生成新列
- c - 表达式内的花括号组返回“没有效果的语句”
- r - 在 R 的子图中创建子图
- c - 在 c 中将 2 个 16 位字连接成一个 16 位字
- r - 从聚合二项式回归生成预测
- user-data - Google Analytics 4 - 用户数据导入未出现在分析中心