Foreground Settings in Windows Forms Progress Bar (ProgressBarAdv)

28 Apr 20219 minutes to read

This section discusses the foreground settings of the ProgressBarAdv control.

Foreground segment settings

The foreground segment settings available in the ProgressBarAdv control are explained below.

The foreground of the ProgressBarAdv can be displayed with a segmented appearance using the property given below.

Property table

ProgressBarAdv property Description
ForeSegments Determines if the foreground is segmented.

By default this property will be set to true. To set it to false, use the code snippet given below.

this.progressBarAdv1.ForeSegments = false;
Me.progressBarAdv1.ForeSegments = False

Overview_img12

Segment width

The foreground segments can be customized using the property given below.

Property table

ProgressBarAdv property Description
SegmentWidth Specifies the width of the segments.
this.progressBarAdv1.SegmentWidth = 20;
Me.progressBarAdv1.SegmentWidth = 20

Overview_img13

Foreground color settings

This section illustrates the color settings that can be applied to the foreground of the ProgressBarAdv.

Font and fore color settings

The font color and the fore color can be set using the properties given below.

Property table

ProgressBarAdv property Description
ForeColor Specifies the color used to draw the foreground in segment mode and constant mode.
FontColor Specifies the color of the font used to draw the text of the ProgressBarAdv.
this.progressBarAdv1.FontColor = System.Drawing.Color.SteelBlue;

this.progressBarAdv1.ForeColor = System.Drawing.Color.Turquoise;
Me.progressBarAdv1.FontColor = System.Drawing.Color.SteelBlue

Me.progressBarAdv1.ForeColor = System.Drawing.Color.Turquoise

Overview_img14

Gradient color settings

The color of the foreground gradient can be changed using the properties given below.

Property table

ProgressBarAdv property Description
GradientStartColor Specifies the start color of the foreground gradient.The ProgressStyle property should be set to 'Gradient'.
GradientEndColor Specifies the start color of the foreground gradient.The ProgressStyle property should be set to 'Gradient'.
this.progressBarAdv1.GradientEndColor = System.Drawing.Color.Yellow;

this.progressBarAdv1.GradientStartColor = System.Drawing.Color.OrangeRed;
Me.progressBarAdv1.GradientEndColor = System.Drawing.Color.Yellow

Me.progressBarAdv1.GradientStartColor = System.Drawing.Color.OrangeRed

Overview_img15

The foreground can be displayed with multiple colors using the property given below.

Property table

ProgressBarAdv property Description
MultipleColors Specifies the array of colors used to draw the multiple gradient of the foreground.The ProgressStyle property should be set to 'MultipleGradient'.
StretchMultiGrad Determines if the multiple gradient will be stretched.
this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.MultipleGradient;

this.progressBarAdv1.MultipleColors = new System.Drawing.Color[] {System.Drawing.Color.Orange, System.Drawing.Color.Yellow, System.Drawing.Color.Blue, System.Drawing.Color.Pink, System.Drawing.Color.Green};

this.progressBarAdv1.StretchMultGrad = false;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.MultipleGradient

Me.progressBarAdv1.MultipleColors = New System.Drawing.Color[] {System.Drawing.Color.Orange, System.Drawing.Color.Yellow, System.Drawing.Color.Blue, System.Drawing.Color.Pink, System.Drawing.Color.Green};

Me.progressBarAdv1.StretchMultGrad = False

Overview_img16

Tube color settings

Colors can be set for the foreground tube of the ProgressBarAdv.

Property table

ProgressBarAdv property Description
TubeStartColor Specifies the start color of the foreground tube.The ProgressStyle property should be set to 'Tube'.
TubeEndColor Specifies the start color of the foreground tube.The ProgressStyle property should be set to 'Tube'.
this.progressBarAdv1.TubeEndColor = System.Drawing.Color.Black;

this.progressBarAdv1.TubeStartColor = System.Drawing.Color.Red;
Me.progressBarAdv1.TubeEndColor = System.Drawing.Color.Black

Me.progressBarAdv1.TubeStartColor = System.Drawing.Color.Red

Overview_img17

Foreground image settings

This section discusses the foreground image settings of ProgressBarAdv.

When the BackgroundStyle and ProgressStyle are set to the ‘Image’ style, then the foreground image can be specified using the below given property.

Property table

ProgressBarAdv property Description
ForegroundImage Determines if the foreground is segmented.
StretchImage Indicates whether the foreground image will be stretched.
this.progressBarAdv1.ForegroundImage = ((System.Drawing.Image)(resources.GetObject("clouds")));

this.progressBarAdv1.StretchImage = true;
Me.progressBarAdv1.ForegroundImage = CType((resources.GetObject("clouds")), System.Drawing.Image)

Me.progressBarAdv1.StretchImage = True

Overview_img18

Foreground style settings

The progress style of the ProgressBarAdv control can be set using the properties given below.

Property table

ProgressBarAdv property Description
ProgressStyle Determines the foreground drawing style. It includes the options given below.Constant, Gradient, MultipleGradient, Tube, Image, System, Metro, Office2016Colorful, Office2016White, Office2016darkGray and Office2016Black.
ProgressFallBackStyle Determines the foreground drawing style when the ProgressStyle is set to 'System', provided the system doesn't support themes.
this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.WaitingGradient;

this.progressBarAdv1.ProgressFallbackStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.MultipleGradient;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.WaitingGradient

Me.progressBarAdv1.ProgressFallbackStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.MultipleGradient;

Overview_img19

The Waiting Gradient Style of the ProgressBarAdv consists of the following properties that can be used to change the appearance and behavior of the style.

Property table

ProgressBarAdv property Description
WaitingGradientEnabled Determines if the waiting gradient is enabled.The ProgressStyle property should be set to 'WaitingGradient'.
WaitingGradientInterval Determines the interval of the waiting gradient.
WaitingGradientWidth Determines the width of the waiting gradient.
CustomWaitingRender Indicates whether the waiting gradient will be replaced by another custom waiting render which is defaulted to segments.This property when set to `true` will display the foreground with segments in the color that has been set for the ForeColor property.This property when set to `false` will display the foreground in the default waiting gradient style.
this.progressBarAdv1.WaitingGradientEnabled = true;

this.progressBarAdv1.WaitingGradientInterval = 20;

this.progressBarAdv1.WaitingGradientWidth = 500;

this.progressBarAdv1.CustomWaitingRender = true;

this.progressBarAdv1.ForeColor = System.Drawing.Color.Crimson;
Me.progressBarAdv1.WaitingGradientEnabled = True

Me.progressBarAdv1.WaitingGradientInterval = 20

Me.progressBarAdv1.WaitingGradientWidth = 500

Me.progressBarAdv1.CustomWaitingRender = True

Me.progressBarAdv1.ForeColor = System.Drawing.Color.Crimson

Overview_img20

Metro

This option helps to set the metro theme.

this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Metro;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Metro;

Overview_img121

Office2016Colorful

This option helps to set the Office2016Colorful appearance.

this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016Colorful;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016Colorful;

Overview_img117

Office2016White

This option helps to set the Office2016White appearance.

this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016White;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016White;

Overview_img118

Office2016DarkGray

This option helps to set the Office2016DarkGray appearance.

this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016DarkGray;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016DarkGray;

Overview_img119

Office2016Black

This option helps to set the Office2016Black appearance.

this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016Black;
Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Office2016Black;

Overview_img120