【问题标题】:Is there any way to change custom task pane color in VSTO outlook add in?有没有办法在 VSTO Outlook 插件中更改自定义任务窗格颜色?
【发布时间】:2016-06-08 23:16:16
【问题描述】:

有没有办法在邮件撰写窗口中更改自定义任务窗格背景颜色?

更新

UserControl.BackColor 给了我这个结果。但我希望整个自定义任务窗格都是白色的

我设置用户控件的代码在这里:

public partial class UserControlTest : UserControl
{
    public UserControlTest()
    {
        this.BackColor = Color.White;
        InitializeComponent();
    }
}

【问题讨论】:

    标签: c# vsto outlook-addin


    【解决方案1】:

    您可以通过设置UserControlBackColor来改变任务面板的背景。

    这就是我将我的颜色设置为与 Visual Studios 深色主题相同的颜色:

    private const string WindowColor = @"#FF2D2D30";
    ...
    var color = ColorTranslator.FromHtml(WindowColor);
    this.BackColor = Color.FromArgb(color.R, color.G, color.B);
    

    在调用 this.InitializeComponent(); 之前,我在 UserControl 的构造函数中执行此操作。

    【讨论】:

    • UserControl.BackColor 没有用指定的颜色填充所有任务窗格。我在我的问题中添加了结果
    • @IvanZaporozhchenko 你能把你的代码发布在你构建UserControl 的地方吗,因为这是我使用的确切代码,所以最好看看你设置控件的方式是否存在差异.我还假设您使用的是 WinForm UserControl?您是否还在 WinForm 中嵌入了 WPF 控件?
    • 我添加了代码。我正在使用 WinForm 用户控件。其实我想在WinForm控件里面嵌入WPF控件,但是没有区别,我试过不嵌入WPF的控件,结果是一样的。
    • 是您要更改的边框/标题,因为我不相信无论如何可以更改边框颜色。只有图像中我看起来像白色的背景,但也许我错过了一些东西。
    • 那么有没有办法改变表头颜色呢?我在这里问了一个类似的问题:stackoverflow.com/questions/41154517/…
    猜你喜欢
    • 2022-11-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    相关资源
    最近更新 更多