Define the theme colors. The colors
array defines the default state colors, the highlightcolors
array define the colors used when the mouse is over the button. The pressedcolors
array defines colors used when the winforms button is pressed.
C#
Color[] colors = new Color[]{Color.FromArgb(255,39,94,176),
Color.FromArgb(255, 37, 92, 175), Color.FromArgb(255,51,105,206),
Color.FromArgb(255,53,135,226)};
Color[] highlightColors = new Color[]{Color.FromArgb(255,59,114,196),
Color.FromArgb(255, 57, 112, 185), Color.FromArgb(255,71,125,226),
Color.FromArgb(255,73,155,246)};
Color[] pressedColors = new Color[]{Color.FromArgb(255,79,134,216),
Color.FromArgb(255, 77, 132, 215), Color.FromArgb(255,91,145,246),
Color.FromArgb(255,93,175,255)};
VB .NET
Dim colors() As Color = {Color.FromArgb(255,39,94,176), _
Color.FromArgb(255, 37, 92, 175), Color.FromArgb(255,51,105,206), _
Color.FromArgb(255,53,135,226)}
Dim highlightColors() As Color = {Color.FromArgb(255,59,114,196), _
Color.FromArgb(255, 57, 112, 185), Color.FromArgb(255,71,125,226), _
Color.FromArgb(255,73,155,246)}
Dim pressedColors() As Color = {Color.FromArgb(255,79,134,216), _
Color.FromArgb(255, 77, 132, 215), Color.FromArgb(255,91,145,246), _
Color.FromArgb(255,93,175,255)}
Define the default, highlight and pressed states. The following code illustrates how to create the styles for the winforms button states. The 90 number is for the gradient angle. This means that the button's gradient will be vertical. The 0.7f and 0.9f define the offset between each gradient color starting from 0 to 1. You can think about this as: 0f - first color, 0.7f - second color, 0.9f third color and 1.0f fourth gradient color.
C#
FillStyleGradientEx normalStyle = new FillStyleGradientEx
(colors[0], colors[1], colors[2], colors[3], 90, 0.7f, 0.9f);
FillStyleGradientEx highlightStyle = new FillStyleGradientEx(highlightColors[0],
highlightColors[1],highlightColors[2], highlightColors[3], 90, 0.7f, 0.9f);
FillStyleGradientEx pressedStyle = new FillStyleGradientEx(pressedColors[0],
pressedColors[1],pressedColors[2], pressedColors[3], 90, 0.7f, 0.9f);
Color borderColor = Color.FromArgb(31, 72, 161);
VB.NET
Dim normalStyle As New FillStyleGradientEx(colors(0), colors(1), _
colors(2), colors(3), 90, 0.7f, 0.9f)
Dim highlightStyle As New FillStyleGradientEx(highlightColors(0), _
highlightColors(1), highlightColors(2), highlightColors(3), 90, 0.7f, 0.9f)
Dim pressedStyle As New FillStyleGradientEx(pressedColors(0), _
pressedColors(1), pressedColors(2), pressedColors(3), 90, 0.7f, 0.9f)
Dim borderColor As Color = Color.FromArgb(31, 72, 161)