2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Customize the appearance of ProgressBarAdvYou can customize the appearance of the ProgressBarAdv when using the ProgressStyle as ProgressBarStyles.WaitingGradient. The customized ProgressBarStyle can be achieved by handling the event, DrawWaitingCustomRender, and enabling the property, CustomWaitingRender in the ProgressBarAdv. C# //Specifies the ProgressBar style. this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.WaitingGradient; //Customizes the waiting to render. this.progressBarAdv1.CustomWaitingRender = true; //Enables the waiting gradient. this.progressBarAdv1.WaitingGradientEnabled = true; //Customize the ProgressBar appearance. this.progressBarAdv1.DrawWaitingCustomRender += new Syncfusion.Windows.Forms.Tools.ProgressBarAdvDrawEventHandler(progressBarAdv1_DrawWaitingCustomRender); //Handles this event to draw a custom waiting to render. void progressBarAdv1_DrawWaitingCustomRender(object sender, Syncfusion.Windows.Forms.Tools.ProgressBarAdvDrawEventArgs e) { Region region = new System.Drawing.Region(); region.MakeEmpty(); region.Union(e.Rectangle); LinearGradientBrush brush = new LinearGradientBrush( new Point(e.Rectangle.X, 0), new Point(e.Rectangle.X + e.Rectangle.Width, 0), Color.Blue, Color.Red); e.Graphics.FillRegion(brush, region); e.Handled = true; } VB ' Specifies the ProgressBar style Me.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.WaitingGradient 'Customizes the waiting to render. Me.progressBarAdv1.CustomWaitingRender = True 'Enables the waiting gradient. Me.progressBarAdv1.WaitingGradientEnabled = True 'Customizes the ProgressBar appearance. AddHandler progressBarAdv1.DrawWaitingCustomRender, AddressOf progressBarAdv1_DrawWaitingCustomRender 'Handles this event to draw a custom waiting to render. Private Sub progressBarAdv1_DrawWaitingCustomRender(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.ProgressBarAdvDrawEventArgs) Dim region As Region = New System.Drawing.Region() region.MakeEmpty() region.Union(e.Rectangle) Dim brush As New LinearGradientBrush(New Point(e.Rectangle.X, 0), New Point(e.Rectangle.X + e.Rectangle.Width, 0), Color.Blue, Color.Red) e.Graphics.FillRegion(brush, region) e.Handled = True End Sub
Note: The property named “WaitingGradientEnabled” helps to enable the waiting gradient style in the ProgressBarAdv.
Figure 1: ProgressStyle specified as WaitingGradient Figure 2: ProgressBar with custom draw in WaitingGradient style Samples: |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.