c# - Is there any way to change border/header background in VSTO outlook add in?
问题描述
I'm developing a VSTO plugin for Outlook 2016 but am not able to change the border and header background color (as you can see from the linked image).
I tried to force the "BackColor" property of the TaskPaneWpfControlHost
object but what happens is that I get the background change of the user control injected into the container.
public TaskPaneWpfControlHost(System.Windows.Controls.UserControl shell)
{
this.BackColor = System.Drawing.Color.White;
InitializeComponent();
wpfElementHost.HostContainer.Children.Add(shell);
wpfElementHost.AutoSize = true;
wpfElementHost.Dock = DockStyle.Fill;
_shell = shell;
}
解决方案
您可以使用 BackColor 参考以下代码:
private const string WindowColor = @"#FF2D2D30";
var color = ColorTranslator.FromHtml(WindowColor);
this.BackColor = Color.FromArgb(color.R, color.G, color.B);
欲了解更多信息,请参阅以下链接:
推荐阅读
- python-3.x - 转向卷积层的零填充输入问题
- c++11 - 何时使用完美转发,何时明确?
- android - Android App Project 停止编译,grade.build 出错
- angularjs - 使用angularjs提供日期时获取一个月的所有日期
- android - Google Maps API 安装警告
- typescript - 如何迭代泛型类型的属性?
- c# - 在 Service Fabric 应用程序中禁用 TLS 握手客户端证书请求
- r - 保留类但不在 R 函数的输出中显示它
- excel - 在 vba 中读取文本文件并根据 excel 中的用户输入修改某个单元格
- algorithm - 不相交集算法的路径压缩技术的复杂性是多少?