有什么方法可以更改 VSTO Outlook 添加中的边框/标题背景吗? [英] Is there any way to change border/header background in VSTO outlook add in?

查看:38
本文介绍了有什么方法可以更改 VSTO Outlook 添加中的边框/标题背景吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Outlook 2016 开发 VSTO 插件,但无法更改边框和标题背景颜色(如您在链接图像中所见).

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).

我试图强制使用 TaskPaneWpfControlHost 对象的BackColor"属性,但结果是我将用户控件的背景更改注入到容器中.

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 参考以下代码:

You could use BackColor refer to the below code:

private const string WindowColor = @"#FF2D2D30";

var color = ColorTranslator.FromHtml(WindowColor);
this.BackColor = Color.FromArgb(color.R, color.G, color.B);

更多信息,请参考以下链接:

For more information, Please refer to the below link:

有没有办法在 VSTO Outlook 插件中更改自定义任务窗格的颜色?

如何:设置 Windows 窗体面板的背景

这篇关于有什么方法可以更改 VSTO Outlook 添加中的边框/标题背景吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆