ProgressBar

The ProgressBar control allow for showing dynamic progress status.

Customizing the progress text

When ShowProgressText is true, text on the progress bar will be displayed.

By default this text shows the percentage completion, according to the Value, Minimum and Maximum. The format of this text can be customised by using the ProgressTextFormat property. This expects a string which will be passed to a string.Format call with the value of ProgressTextFormat as the format string. The following format items are available at the given indices:

  • 0 = Value

  • 1 = Value as a Percentage from 0 to 100 (e.g. Minimum = 0, Maximum = 50, Value = 25, then Percentage = 50)

  • 2 = Minimum

  • 3 = Maximum

Progress Text Format Example

MinMaxValueFormat StringOutput

0

20

17

{0}/{3} Tasks Complete ({1:0}%)

17/20 Tasks Complete (85%)

Reference

ProgressBar

Source code

ProgressBar.cs

最后更新于