ActivityDesignerTheme.BackColorStart 属性
定义
获取或设置对背景使用颜色渐变时背景的起始颜色。Gets or sets the starting color of the background when using a color gradient on the background.
public:
virtual property System::Drawing::Color BackColorStart { System::Drawing::Color get(); void set(System::Drawing::Color value); };
[System.ComponentModel.TypeConverter(typeof(System.Workflow.ComponentModel.Design.ColorPickerConverter))]
public virtual System.Drawing.Color BackColorStart { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Workflow.ComponentModel.Design.ColorPickerConverter))>]
member this.BackColorStart : System.Drawing.Color with get, set
Public Overridable Property BackColorStart As Color
属性值
作为背景的起始颜色的 Color。The background starting Color.
- 属性
示例
下面的示例演示如何通过从 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)
{
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 类。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
注解
BackColorStart 指示背景色或背景渐变的起始颜色。BackColorStart indicates the background color, or the beginning color of a background gradient. 若要使用背景渐变颜色,请设置 BackColorStart 和 BackColorEnd 属性。To use background gradient color, set the BackColorStart and BackColorEnd properties. 背景会逐渐地从起始颜色变为结束颜色。The background will gradually change color from the start color to the end color.