有什么方法可以在VSTO Outlook Add in中更改自定义任务窗格的颜色? [英] Is there any way to change custom task pane color in VSTO outlook add in?
问题描述
有什么方法可以在邮件撰写窗口中更改自定义任务窗格的背景颜色吗?
Is there any way to change custom task pane background color in mail compose window ?
更新
UserControl.BackColor给了我这个结果.但我希望整个自定义任务窗格为白色
UserControl.BackColor gives me this result. But I want whole custom task pane to be white
我用于设置用户控件的代码在这里:
My code for setting up usercontrol is here:
public partial class UserControlTest : UserControl
{
public UserControlTest()
{
this.BackColor = Color.White;
InitializeComponent();
}
}
推荐答案
您可以通过设置UserControl
的BackColor
来更改任务面板的背景.
You can change the background of the task panel by setting the BackColor
of the UserControl
.
这是我将我的颜色设置为与Visual Studios深色主题相同的颜色的方法:
This is how I set mine to the same color as Visual Studios dark theme:
private const string WindowColor = @"#FF2D2D30";
...
var color = ColorTranslator.FromHtml(WindowColor);
this.BackColor = Color.FromArgb(color.R, color.G, color.B);
我在调用this.InitializeComponent();
之前在UserControl
的构造函数中执行此操作.
I do this within the constructor of the UserControl
before calling this.InitializeComponent();
.
这篇关于有什么方法可以在VSTO Outlook Add in中更改自定义任务窗格的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!