Skip to content

ProgressBar

Alexandru Iuga edited this page Apr 5, 2022 · 5 revisions

Description

Displays a progress bar and the associated underlying value.

Features

  • Custom label text - A custom text can be provided to be displayed in front of the control.
  • Optional label text - The label text can be hidden.
  • Custom value positioning - Can specify to display the underlying value at the left or right of the progress bar.
  • Custom unit of measurement - A custom text can be provided to be displayed after the value.
  • Custom value range - The margin of the value range can be changed using the MinValue and MaxValue properties.
  • Allow values outside range - If the value to be displayed is outside the progress bar range, the closest margin is displayed instead.

In the future

  • Optional value display - Can decide if the underlying value should be displayed or not.

Example

ManualResetEventSlim finishEvent = new ManualResetEventSlim();
finishEvent.Reset();

Spinners.ProgressBar progressBar = new Spinners.ProgressBar();

Task.Run<Task>(async () =>
{
    progressBar.Display();

    for (int i = 0; i < 100; i++)
    {
        await Task.Delay(100);
        progressBar.Value++;
    }

    finishEvent.Set();
});

finishEvent.Wait();

progressBar.Close();

Result:

ProgressBar Example Result

Clone this wiki locally