问题

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