ProgressBar Class
Definition
Section titled “Definition”A control that fills an area (vertical or horizontal) according to a value.
[DataContract]public class ProgressBar : ControlBaseInheritance object → ControlBase
Constructors
Section titled “Constructors”ProgressBar(int, int, HorizontalAlignment)
Section titled “ProgressBar(int, int, HorizontalAlignment)”Creates a new horizontal progress bar.
public ProgressBar(int width, int height, HorizontalAlignment horizontalAlignment)Parameters
Section titled “Parameters”width int
Width of the control.
height int
Height of the control.
horizontalAlignment HorizontalAlignment
Sets the control to be horizontal, starting from the specified side. Center/Stretch is invalid.
Exceptions
Section titled “Exceptions”InvalidOperationException
Thrown when horizontalAlignment is set to either Center or Stretch.
ProgressBar(int, int, VerticalAlignment)
Section titled “ProgressBar(int, int, VerticalAlignment)”Creates a new vertical progress bar.
public ProgressBar(int width, int height, VerticalAlignment verticalAlignment)Parameters
Section titled “Parameters”width int
Width of the control.
height int
Height of the control.
verticalAlignment VerticalAlignment
Sets the control to be vertical, starting from the specified side. Center/Stretch is invalid.
Exceptions
Section titled “Exceptions”InvalidOperationException
Thrown when verticalAlignment is set to either Center or Stretch.
Fields
Section titled “Fields”progressValue
Section titled “progressValue”The progress bar fill value. Between 0f and 1f.
[DataMember]protected float progressValuecontrolSize
Section titled “controlSize”The size of the bar.
[DataMember]protected int controlSizefillSize
Section titled “fillSize”For theme use only. The size of the bar currently filled based on the Progress property.
[DataMember]public int fillSizeisHorizontal
Section titled “isHorizontal”Flag to indicate this bar was created horizontal.
[DataMember]protected bool isHorizontalhorizontalAlignment
Section titled “horizontalAlignment”The alignment if the bar is horizontal.
[DataMember]protected HorizontalAlignment horizontalAlignmentverticalAlignment
Section titled “verticalAlignment”The alignment if the bar is vertical.
[DataMember]protected VerticalAlignment verticalAlignmentProperties
Section titled “Properties”DisplayText
Section titled “DisplayText”An optional text to display on the bar. If set to "%", displays the percentage of the progress.
[DataMember]public string DisplayText { get; set; }DisplayTextAlignment
Section titled “DisplayTextAlignment”Alignment to print the DisplayText. Stretch is invalid for the property.
[DataMember]public HorizontalAlignment DisplayTextAlignment { get; set; }HorizontalAlignment
Section titled “HorizontalAlignment”The horizontal orientation used when IsHorizontal is set to true.
public HorizontalAlignment HorizontalAlignment { get; set; }VerticalAlignment
Section titled “VerticalAlignment”The vertical orientation used when IsHorizontal is set to false.
public VerticalAlignment VerticalAlignment { get; set; }IsHorizontal
Section titled “IsHorizontal”When true, the progress bar uses the HorizontalAlignment property to determine the starting fill direction. When false, uses the VerticalAlignment property.
public bool IsHorizontal { get; set; }Progress
Section titled “Progress”Gets or sets the value of the scrollbar between 0.0 and 1.0.
public float Progress { get; set; }ThemeStateBar
Section titled “ThemeStateBar”The theme of the progressed part of the bar.
[DataMember]public ThemeStates ThemeStateBar { get; protected set; }DisplayTextStates
Section titled “DisplayTextStates”The theme of the text displayed on the bar.
[DataMember]public ThemeStates DisplayTextStates { get; protected set; }BackgroundGlyph
Section titled “BackgroundGlyph”The glyph to use when drawing the unfilled part of the bar.
[DataMember]public int BackgroundGlyph { get; set; }BarGlyph
Section titled “BarGlyph”The glyph to use when drawing the filled part of the bar.
[DataMember]public int BarGlyph { get; set; }DisplayTextColor
Section titled “DisplayTextColor”The color to print the DisplayText string.
[DataMember]public Color? DisplayTextColor { get; set; }BarColor
Section titled “BarColor”The color to print the filled part of the progress bar.
[DataMember]public Color? BarColor { get; set; }PrintDisplayAsDecorator
Section titled “PrintDisplayAsDecorator”When true, prints the DisplayText on the control in decorators instead of replacing the portation of the bar that overlaps the text.
[DataMember]public bool PrintDisplayAsDecorator { get; set; }Methods
Section titled “Methods”ProcessKeyboard(Keyboard)
Section titled “ProcessKeyboard(Keyboard)”Called when the control should process keyboard information.
public override bool ProcessKeyboard(Keyboard info)Parameters
Section titled “Parameters”info Keyboard
The keyboard information.
Returns
Section titled “Returns”bool
True if the keyboard was handled by this control.
RefreshThemeStateColors(Colors)
Section titled “RefreshThemeStateColors(Colors)”Updates the ThemeState by calling RefreshTheme(Colors) with the provided colors. Override this method to adjust how colors are used by the ThemeState.
protected override void RefreshThemeStateColors(Colors colors)Parameters
Section titled “Parameters”colors Colors
The colors to apply to the theme state.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Redraws the control if applicable.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The duration of thecurrent frame.
Events
Section titled “Events”ProgressChanged
Section titled “ProgressChanged”Called when the Progress property value changes.
public event EventHandler? ProgressChanged