We regret to let you know that, at present ProgressBarAdv doesn’t have a direct support to specify the Office Color theme (blue, black and silver). Alternatively, the reported requirement can be achieved by handling its event named “DrawWaitingCustomRender” and enabling the property named “CustomWaitingRender” to custom draw the waiting render in ProgressBarAdv. Please make use of the following code example for your reference.
Code Snippet [C#]:
//To specify the ProgressBar Stle this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.WaitingGradient; //To customize the Waiting render this.progressBarAdv1.CustomWaitingRender = true; //To enable the waiting gradient this.progressBarAdv1.WaitingGradientEnabled = true; //To customize the appearance of the Waiting render. this.progressBarAdv1.DrawWaitingCustomRender += new Syncfusion.Windows.Forms.Tools.ProgressBarAdvDrawEventHandler(progressBarAdv1_DrawWaitingCustomRender);
//Handle this event to draw a custom waiting render void progressBarAdv1_DrawWaitingCustomRender(object sender, Syncfusion.Windows.Forms.Tools.ProgressBarAdvDrawEventArgs e) { Region region = new System.Drawing.Region(); region.MakeEmpty(); region.Union(e.Rectangle); Brush brush = new SolidBrush(Color.FromArgb(187, 212, 246)); e.Graphics.FillRegion(brush, region); e.Handled = true; } |
Screenshot:
We have also prepared sample for your reference and it can be downloaded from the following location:
Sample Location: https://www.syncfusion.com/downloads/support/forum/120023/ze/ProgressBarAdv_CustomDraw-1892965157
Could you please look into the above sample and let us know whether it helps.
Please let us know if you need any further assistance,
Regards,
Saravanan T
//To display percentage value in ProgressBarAdv this.progressBarAdv1.TextStyle = Syncfusion.Windows.Forms.Tools.ProgressBarTextStyles.Percentage; |
Query 2: Also is it possible to get multiple colors for the progress bar like the sample image (where the top half and bottom half are different colors)?
Yes it is possible to get multiple color for the ProgressBarAdv as shown in the image provided by you using the property named ProgressStyle. Please make use of the below code example,
Code Example[C#]:
//To set style for ProgressBarAdv this.progressBarAdv1.ProgressStyle = Syncfusion.Windows.Forms.Tools.ProgressBarStyles.Tube;
//To set TubeEnd Color this.progressBarAdv1.TubeEndColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(146)))), ((int)(((byte)(242))))); //To set TubeStart color this.progressBarAdv1.TubeStartColor = System.Drawing.Color.Lime;
|