ActivityDesignerTheme.ForeColor 屬性

定義

取得或設定前景色彩。

C#
[System.ComponentModel.TypeConverter(typeof(System.Workflow.ComponentModel.Design.ColorPickerConverter))]
public virtual System.Drawing.Color ForeColor { get; set; }

屬性值

Color

Color,表示主題的前景色彩。

屬性

範例

下列範例示範如何建立自訂 ActivityDesignerTheme,其方式是從 ActivityDesignerTheme 類別衍生,並為新主題設定適當的屬性。

C#
public class CustomActivityDesignerTheme : ActivityDesignerTheme
{
    public CustomActivityDesignerTheme(WorkflowTheme theme)
        : base(theme)
    {
        base.Initialize();
        this.BorderStyle = DashStyle.Solid;
        this.BorderColor = Color.FromArgb(0, 0, 0);
        this.BackColorStart = Color.FromArgb(37, 15, 242);
        this.BackColorEnd = Color.FromArgb(189, 184, 254);
        this.BackgroundStyle = LinearGradientMode.Vertical;
        this.ForeColor = Color.Black;
    }
}

若要使用 ActivityDesigner 上的主題,請將 ActivityDesignerThemeAttribute 套用至 ActivityDesigner 類別。

C#
[ActivityDesignerTheme(typeof(CustomActivityDesignerTheme))]
public class CustomActivityDesigner2 : ActivityDesigner

備註

使用 ForeColor 屬性,指定主題的前景色彩。 前景色彩通常是文字的色彩。

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8