Bewerken

Delen via


ActivityDesignerTheme.BackgroundStyle Property

Definition

Gets or sets the background style.

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

Property Value

A LinearGradientMode that describes the background style.

Examples

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)
    {
        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

To use the theme on an ActivityDesigner, apply the ActivityDesignerThemeAttribute to the ActivityDesigner class.

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

Remarks

Use BackgroundStyle to get or set how the background displays color. The BackgroundStyle can be set to one of four modes:

BackwardDiagonal
Specifies a gradient from upper right to lower left.

ForwardDiagonal
Specifies a gradient from upper left to lower right.

Horizontal
Specifies a gradient from left to right.

Vertical
Specifies a gradient from top to bottom.

Applies to