Class ButtonVisualStyle
Represents the class to define the style for SfButton control.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.WinForms.Controls.Styles
Assembly: Syncfusion.Core.WinForms.dll
Syntax
public class ButtonVisualStyle : VisualStyleBase, ICustomTypeDescriptor, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject
Constructors
ButtonVisualStyle()
Initializes a new instance of the ButtonVisualStyle class.
Declaration
public ButtonVisualStyle()
ButtonVisualStyle(StyleInfoSubObjectIdentity)
Initializes a new instance of the ButtonVisualStyle class.
Declaration
public ButtonVisualStyle(StyleInfoSubObjectIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoSubObjectIdentity | identity | A ButtonStyleInfoIdentity that holds the identity for this ButtonStyleInfoStore. |
ButtonVisualStyle(StyleInfoSubObjectIdentity, StyleInfoStore)
Initializes a new instance of the ButtonVisualStyle class.
Declaration
public ButtonVisualStyle(StyleInfoSubObjectIdentity identity, StyleInfoStore store)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoSubObjectIdentity | identity | A ButtonStyleInfoIdentity that holds the identity for this ButtonStyleInfoStore. |
StyleInfoStore | store | The store. |
Properties
BackColor
Gets or sets the background color of the SfButton control.
Declaration
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to fill the background of the button. |
Remarks
This color has filled to background of the button only when set the
Border
Gets or sets the System.Drawing.Pen value used to draw the border of the SfButton control in default state.
Declaration
public Pen Border { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Pen | The System.Drawing.Pen value is used to draw the border of the button. The default value is null. |
DefaultStyle
Gets the default style value for the SfButton control.
Declaration
public static ButtonVisualStyle DefaultStyle { get; }
Property Value
Type |
---|
ButtonVisualStyle |
DisabledBackColor
Gets or sets the background color of the SfButton control in the disabled state.
Declaration
public Color DisabledBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to fill the background of the button. |
Remarks
This color has filled to background of the button only when set the DisabledGradientBrush property to null.
DisabledBorder
Gets or sets the System.Drawing.Pen value used to draw the border of the SfButton control in disabled state.
Declaration
public Pen DisabledBorder { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Pen | The System.Drawing.Pen value is used to draw the border of the button. The default value is null. |
DisabledForeColor
Gets or sets the fore color value of the SfButton control in disabled state.
Declaration
public Color DisabledForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the text of the button. |
Remarks
The text will draw on the button by using this color value, when the button state is disabled.
DisabledGradientBrush
Gets or sets the BrushInfo used to fill the background of the SfButton control in disabled state. The default value is null.
Declaration
public BrushInfo DisabledGradientBrush { get; set; }
Property Value
Type |
---|
BrushInfo |
Remarks
If this value is null, the DisabledBackColor is used to fill the background of the button in disabled state.
Examples
This example shows how to initialize the DisabledGradientBrush property.
// Initialize the disabled gradient brush value to SfButton.
sfButton1.Style.DisabledGradientBrush = new Syncfusion.WinForms.Core.BrushInfo(Syncfusion.WinForms.Core.GradientStyle.BackwardDiagonal, new Color[] { Color.Red, Color.Green });
DisabledImage
Gets or sets the image that is displayed on a button control in disabled state.
Declaration
public Image DisabledImage { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image value used to displayed on the button. The default value is null. |
Remarks
The SfButton does allows to animate, when set the animated GIF file to DisabledImage property and even the AllowImageAnimation property is true. If the Image property is animated GIF file then this property not used in button.
DisabledImageForeColor
Gets or sets the fore color of the image that will be displayed on the SfButton control in disabled state.
Declaration
public Color DisabledImageForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the image. The default value is Color.Empty. |
FocusedBackColor
Gets or sets the fore color of the SfButton control in focused state.
Declaration
public Color FocusedBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to fill the background of the button. |
Remarks
This color has filled to background of the button only when set the FocusedGradientBrush property to null.
FocusedBorder
Gets or sets the System.Drawing.Pen value used to draw the border of the SfButton control in focused state.
Declaration
public Pen FocusedBorder { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Pen | The System.Drawing.Pen value is used to draw the border of the button. The default value is null. |
FocusedForeColor
Gets or sets the fore color value of the SfButton control in focused state.
Declaration
public Color FocusedForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the text of the button. |
Remarks
The text will draw on the button by using this color value, when the button state is focused.
FocusedGradientBrush
Gets or sets the BrushInfo used to fill the background of the SfButton control in focused state. The default value is null.
Declaration
public BrushInfo FocusedGradientBrush { get; set; }
Property Value
Type |
---|
BrushInfo |
Remarks
If this value is null, the FocusedBackColor is used to fill the background of the button in focused state.
Examples
This example shows how to initialize the FocusedGradientBrush property.
// Initialize the focused gradient brush value to SfButton.
sfButton1.Style.FocusedGradientBrush = new Syncfusion.WinForms.Core.BrushInfo(Syncfusion.WinForms.Core.GradientStyle.BackwardDiagonal, new Color[] { Color.Red, Color.Green });
FocusedImage
Gets or sets the image that is displayed on a button control in focused state.
Declaration
public Image FocusedImage { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image value used to displayed on the button. The default value is null. |
Remarks
The SfButton does not allows to animate, when set the animated GIF file to FocusedImage property and even the AllowImageAnimation property is true. If the Image property is animated GIF file then this property not used in button.
FocusedImageForeColor
Gets or sets the fore color of the image that will be displayed on the SfButton control in focused state.
Declaration
public Color FocusedImageForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the image on focused state of the button. The default value is Color.Empty. |
ForeColor
Gets or sets the fore color value of the SfButton control.
Declaration
public Color ForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the text of the button. |
Remarks
The text will draw on the button by using this color value, when the button state is default.
GradientBrush
Gets or sets the BrushInfo used to fill the background of the SfButton control in default state. The default value is null.
Declaration
public BrushInfo GradientBrush { get; set; }
Property Value
Type |
---|
BrushInfo |
Remarks
If this value is null, the BackColor is used to fill the background of the button in default state.
Examples
This example shows how to initialize the GradientBrush property.
// Initialize the gradient brush value to SfButton.
sfButton1.Style.GradientBrush = new Syncfusion.WinForms.Core.BrushInfo(Syncfusion.WinForms.Core.GradientStyle.BackwardDiagonal, new Color[] { Color.Red, Color.Green });
HoverBackColor
Gets or sets the background color of the SfButton control in mouse hover state.
Declaration
public Color HoverBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to fill the background of the button. |
Remarks
This color has filled to background of the button only when set the HoverGradientBrush property to null.
HoverBorder
Gets or sets the System.Drawing.Pen value used to draw the border of the SfButton control in hover state.
Declaration
public Pen HoverBorder { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Pen | The System.Drawing.Pen value is used to draw the border of the button. The default value is null. |
HoverForeColor
Gets or sets the fore color value of the SfButton control in hover state.
Declaration
public Color HoverForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the text of the button. |
Remarks
The text will draw on the button by using this color value, when the button state is hover.
HoverGradientBrush
Gets or sets the BrushInfo used to fill the background of the SfButton control in hover state. The default value is null.
Declaration
public BrushInfo HoverGradientBrush { get; set; }
Property Value
Type |
---|
BrushInfo |
Remarks
If this value is null, the HoverBackColor is used to fill the background of the button in hover state.
Examples
This example shows how to initialize the HoverGradientBrush property.
// Initialize the hover gradient brush value to SfButton.
sfButton1.Style.HoverGradientBrush = new Syncfusion.WinForms.Core.BrushInfo(Syncfusion.WinForms.Core.GradientStyle.BackwardDiagonal, new Color[] { Color.Red, Color.Green });
HoverImage
Gets or sets the image that is displayed on a button control in hover state.
Declaration
public Image HoverImage { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image value used to displayed on the button. The default value is null. |
Remarks
The SfButton does not allows to animate, when set the animated GIF file to HoverImage property and even the AllowImageAnimation property is true. If the Image property is animated GIF file then this property not used in button.
HoverImageForeColor
Gets or sets the fore color of the image that will be displayed on the SfButton control in hover state.
Declaration
public Color HoverImageForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the image. The default value is Color.Empty. |
Image
Gets or sets the image that is displayed on a button control in default state.
Declaration
public Image Image { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image value used to displayed on the button. The default value is null. |
Remarks
The SfButton allows to animate, when set the animated GIF file to Image property and enable the AllowImageAnimation property is true.
ImageForeColor
Gets or sets the fore color of the image that will be displayed on the SfButton control in default state.
Declaration
public Color ImageForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the image. The default value is Color.Empty. |
PressedBackColor
Gets or sets the background color of the SfButton control in pressed state.
Declaration
public Color PressedBackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to fill the background of the button. |
Remarks
This color has filled to background of the button only when set the PressedGradientBrush property to null.
PressedBorder
Gets or sets the System.Drawing.Pen value used to draw the border of the SfButton control in pressed state.
Declaration
public Pen PressedBorder { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Pen | The System.Drawing.Pen value is used to draw the border of the button. The default value is null. |
PressedForeColor
Gets or sets the fore color value of the SfButton control in pressed state
Declaration
public Color PressedForeColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Remarks
The text will draw on the button by using this color value, when the button state is pressed.
PressedGradientBrush
Gets or sets the BrushInfo used to fill the background of the SfButton control in pressed state. The default value is null.
Declaration
public BrushInfo PressedGradientBrush { get; set; }
Property Value
Type |
---|
BrushInfo |
Remarks
If this value is null, the PressedBackColor is used to fill the background of the button in pressed state.
Examples
This example shows how to initialize the PressedGradientBrush property.
// Initialize the pressed gradient brush value to SfButton.
sfButton1.Style.PressedGradientBrush = new Syncfusion.WinForms.Core.BrushInfo(Syncfusion.WinForms.Core.GradientStyle.BackwardDiagonal, new Color[] { Color.Red, Color.Green });
PressedImage
Gets or sets the image that is displayed on a button control in pressed state.
Declaration
public Image PressedImage { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image value used to displayed on the button. The default value is null. |
Remarks
The SfButton does not allows to animate, when set the animated GIF file to PressedImage property and even the AllowImageAnimation property is true. If the Image property is animated GIF file then this property not used in button.
PressedImageForeColor
Gets or sets the fore color of the image that will be displayed on the SfButton control in pressed state.
Declaration
public Color PressedImageForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The System.Drawing.Color value is used to draw the image. The default value is Color.Empty. |
Methods
Dispose(Boolean)
Clean up any resources being used.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | True if managed resources should be disposed; otherwise, false. |
Overrides
GetDefaultStyle()
Gets the default style value of the ButtonVisualStyle class.
Declaration
protected override StyleInfoBase GetDefaultStyle()
Returns
Type | Description |
---|---|
StyleInfoBase | Returns the default style value. |