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
指定从上到下的渐变。

适用于