github编辑

ProgressBar

The ProgressBar control allow for showing dynamic progress status.

Customizing the progress text

When ShowProgressTextarrow-up-right is true, text on the progress bar will be displayed.

Basic Progress Bar

By default this text shows the percentage completion, according to the Valuearrow-up-right, Minimumarrow-up-right and Maximumarrow-up-right. The format of this text can be customised by using the ProgressTextFormat property. This expects a string which will be passed to a string.Formatarrow-up-right 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

Min
Max
Value
Format String
Output

0

20

17

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

17/20 Tasks Complete (85%)

Reference

ProgressBararrow-up-right

Source code

ProgressBar.csarrow-up-right

最后更新于

这有帮助吗?