共用方式為


ActivityDesignerTheme.BackgroundStyle 屬性

定義

取得或設定背景樣式。

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

屬性值

LinearGradientMode

LinearGradientMode,描述背景樣式。

範例

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

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;
    }
}
Public Class CustomActivityDesignerTheme
    Inherits ActivityDesignerTheme
    Public Sub New(ByVal theme As WorkflowTheme)
        MyBase.new(theme)

        MyBase.Initialize()
        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 類別。

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

備註

您可以使用 BackgroundStyle 來取得或設定背景顯示色彩的方式。 BackgroundStyle 可以設為四種模式的其中一種:

BackwardDiagonal
指定從右上至左下的漸層。

ForwardDiagonal
指定從左上至右下的漸層。

Horizontal
指定從左至右的漸層。

Vertical
指定從上至下的漸層。

適用於