Is there any way to change border/header background in VSTO outlook add in?

风格不统一 提交于 2020-01-30 08:13:45

问题


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;
    }

回答1:


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:

Is there any way to change custom task pane color in VSTO outlook add in?

How to: Set the Background of a Windows Forms Panel



来源:https://stackoverflow.com/questions/53285132/is-there-any-way-to-change-border-header-background-in-vsto-outlook-add-in

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!