ActivityDesignerTheme.ForeColor 屬性


取得或設定前景色彩。Gets or sets the color of the foreground.

 virtual property System::Drawing::Color ForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public virtual System.Drawing.Color ForeColor { get; set; }
member this.ForeColor : System.Drawing.Color with get, set
Public Overridable Property ForeColor As Color


Color,表示主題的前景色彩。A Color that represents the foreground color of the theme.



下列範例示範如何建立自訂 ActivityDesignerTheme,其方式是從 ActivityDesignerTheme 類別衍生,並為新主題設定適當的屬性。The following example shows how to create a custom ActivityDesignerTheme by deriving from the ActivityDesignerTheme class and setting the appropriate properties for the new theme.

public class CustomActivityDesignerTheme : ActivityDesignerTheme
    public CustomActivityDesignerTheme(WorkflowTheme theme)
        : base(theme)
        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;
Public Class CustomActivityDesignerTheme
    Inherits ActivityDesignerTheme
    Public Sub New(ByVal theme As WorkflowTheme)

        Me.BorderStyle = DashStyle.Solid
        Me.BorderColor = Color.FromArgb(0, 0, 0)
        Me.BackColorStart = Color.FromArgb(37, 15, 242)
        Me.BackColorEnd = Color.FromArgb(189, 184, 254)
        Me.BackgroundStyle = LinearGradientMode.Vertical
        Me.ForeColor = Color.Black
    End Sub
End Class

若要使用 ActivityDesigner 上的主題,請將 ActivityDesignerThemeAttribute 套用至 ActivityDesigner 類別。To use the theme on an ActivityDesigner, apply the ActivityDesignerThemeAttribute to the ActivityDesigner class.

public class CustomActivityDesigner2 : ActivityDesigner
<ActivityDesignerTheme(GetType(CustomActivityDesignerTheme))> _
Public Class CustomActivityDesigner2
    Inherits ActivityDesigner


使用 ForeColor 屬性,指定主題的前景色彩。Use the ForeColor property to specify the foreground color of the theme. 前景色彩通常是文字的色彩。The foreground color is usually the color of the text.