Articles in this section
Category / Section

How to display custom text in the WinForms ProgressBarAdv?

1 min read

Display the custom text

You can display the custom text in the ProgressBarAdv to indicate the status of the task instead of the percentage or value complete. The steps to achieve this are as follows.

  1. Set the ProgressBarAdv’s TextStyle to Custom.
  2. Handle the ProgressBarAdv's ValueChanged event, and set e.Text = "your desired text" and e.Handled = True.

The following code example demonstrates the same.

C#

//Raises the value changed event.
this.progressBarAdv1.ValueChanged += new Syncfusion.Windows.Forms.Tools.ProgressBarValueChangedEventHandler(progressBarAdv1_ValueChanged);
//Specifies the ProgressBarAdv text value.
void progressBarAdv1_ValueChanged(object sender, Syncfusion.Windows.Forms.Tools.ProgressBarValueChangedEventArgs e)
{
    e.Text = "ProgressBarvalue is changing";
    e.Handled = true;
}

VB

'Raises the value changed event.
AddHandler progressBarAdv1.ValueChanged, AddressOf progressBarAdv1_ValueChanged
'Specifies the ProgressBarAdv text value.
Private Sub progressBarAdv1_ValueChanged(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Tools.ProgressBarValueChangedEventArgs)
 e.Text = "ProgressBarvalue is changing"
 e.Handled = True
End Sub

Specified the text value as custom

Figure 1: ProgressBarAdv Text value specified as Custom

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied