AdvancedProgressBar Class

Represents a progress bar with advanced capabilities.

See the online help for an animated image example.

Definition

Namespace: KGySoft.WinForms.Controls
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
[ToolboxBitmapAttribute(typeof(ProgressBar))]
public class AdvancedProgressBar : ProgressBar
Inheritance
Object    MarshalByRefObject    Component    Control    ProgressBar    AdvancedProgressBar

Remarks

The AdvancedProgressBar class offers the following features in addition to ProgressBar:
  • Paused/error state (see State property).
  • New Style property with four different appearances.
  • Custom colors (when Style is not System)

Examples

The following image illustrates a few features of the AdvancedProgressBar class, like the various Styles, and the stopped/paused States which are not supported by a regular ProgressBar (as of .NET 10.0). The System style reflects the Windows 11 appearance:

AdvancedProgressBar in the KGySoft.WinForms.Example application

  Tip

The image above is from the example application. At the Releases page of the project repository you can download it as executable binaries as well.

Constructors

AdvancedProgressBar Creates a new instance of AdvancedProgressBar.

Properties

CreateParamsGets the required creation parameters when the control handle is created.
(Overrides ProgressBarCreateParams)
ErrorStateColor Gets or sets the fore color of the error State. Applicable only when Style is not System.
Default value: Red.
ForeColor Gets or sets the foreground color of the control. Has effect when Style is not System, or when visual styles are not enabled.
Default value: depends on Style.
(Overrides ControlForeColor)
IsMarquee Gets or sets whether the progress bar should operate in marquee mode.
Default value: .
MarqueeAnimationSpeed Gets or sets the interval in milliseconds between two frames of the marquee animation.
Default value: 100.
PausedStateColor Gets or sets the fore color of the paused State. Applicable only when Style is not System.
Default value: Yellow.
State Gets or sets the state of the progress bar. On pre-Vista Windows versions, or when Application.EnableVisualStyles was not called in the executing application, applicable only for non-System Styles. The progress bar stops animating when state is not Normal.
Default value: Normal.

See the online help for an animated image example.
Style Gets or sets the rendering style of the AdvancedProgressBar. When visual styles are not available, ThemedShiny and ThemedFlat styles are defaulting to Classic style.
Default value: System.

See the online help for an animated image example.
Value Gets or sets the current position of the progress bar.
Default value: 0.

Methods

DisposeReleases the unmanaged resources used by the Control and its child controls and optionally releases the managed resources.
(Overrides ControlDispose(Boolean))
OnHandleCreatedRaises the HandleCreated event.
(Overrides ProgressBarOnHandleCreated(EventArgs))
OnPaintRaises the Paint event.
(Overrides ControlOnPaint(PaintEventArgs))
OnPaintBackgroundPaints the background of the control.
(Overrides ControlOnPaintBackground(PaintEventArgs))
OnSizeChangedRaises the SizeChanged event.
(Overrides ControlOnSizeChanged(EventArgs))
WndProcProcesses Windows messages.
(Overrides ControlWndProc(Message))

Extension Methods

GetFormatFlags Gets the formatting flags for the text of a custom drawn control.
(Defined by ControlExtensions)
GetScale Gets the current scale factor of the specified control. If per-monitor DPI awareness is not enabled, it always returns SystemScale.
(Defined by ScaleHelper)
GetScrollBarSize Gets the recommended width and height of scrollbars matching the current scaling of the specified control.
(Defined by ScaleHelper)
HasDefaultScaling Gets whether the display that the specified control belongs to has the same DPI as the initial DPI of the primary display.
(Defined by ScaleHelper)
ScaleHeight Scales the specified height by the vertical scale factor of the control.
(Defined by ScaleHelper)
ScaleSize Scales the specified size by the scale factor of the control.
(Defined by ScaleHelper)
ScaleWidth Scales the specified width by the horizontal scale factor of the control.
(Defined by ScaleHelper)
SetControlEnabled Sets the Enabled property of the child controls within the specified root control, or the Enabled property of the specified control itself, if it is not a recognized container control. By this way pages of a TabControl will remain selectable, a SplitContainer remains resizable, etc.
(Defined by ControlExtensions)
SetControlReadonly Recursively sets the read-only state in the children of the specified root control. Affects TextBoxBase and IReadOnlyCapable instances.
(Defined by ControlExtensions)
SetDoubleBuffered Sets the double buffered state of a control
(Defined by ControlExtensions)
SetStyle Sets a specified ControlStyles flag to either or . It calls the protected Control.SetStyle method on the specified control as if it was a public method.
(Defined by ControlExtensions)

See Also