Export (0) Print
Expand All

ActivityDesignerTheme.BackgroundStyle Property

Gets or sets the background style.

Namespace:  System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

public virtual LinearGradientMode BackgroundStyle { get; set; }

Property Value

Type: System.Drawing.Drawing2D.LinearGradientMode
A LinearGradientMode that describes the background style.

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


Specifies a gradient from upper right to lower left.


Specifies a gradient from upper left to lower right.


Specifies a gradient from left to right.


Specifies a gradient from top to bottom.

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;

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

public class CustomActivityDesigner2 : ActivityDesigner

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0
© 2015 Microsoft