System.Windows.Forms.ToolStripProgressBar Class

Represents a Windows progress bar control contained in a System.Windows.Forms.StatusStrip.

See Also: ToolStripProgressBar Members

Syntax

[System.ComponentModel.DefaultProperty("Value")]
public class ToolStripProgressBar : ToolStripControlHost

Remarks

System.Windows.Forms.ToolStripProgressBar is the System.Windows.Forms.ProgressBar optimized for hosting in a System.Windows.Forms.ToolStrip. A subset of the hosted control's properties and events are exposed at the System.Windows.Forms.ToolStripProgressBar level, but the underlying System.Windows.Forms.ProgressBar control is fully accessible through the ToolStripProgressBar.ProgressBar property.

A System.Windows.Forms.ToolStripProgressBar control visually indicates the progress of a lengthy operation. The System.Windows.Forms.ToolStripProgressBar control displays a bar that fills in from left to right with the system highlight color as an operation progresses.

Note:

The System.Windows.Forms.ToolStripProgressBar control can only be oriented horizontally.

The System.Windows.Forms.ToolStripProgressBar control is typically used when an application performs tasks such as copying files or printing documents. Users of an application might consider an application unresponsive if there is no visual cue. Use the System.Windows.Forms.ToolStripProgressBar to notify the user that the application is performing a lengthy task and that the application is still responding.

The ToolStripProgressBar.Maximum and ToolStripProgressBar.Minimum properties define the range of values to represent the progress of a task. The ToolStripProgressBar.Minimum property is typically set to a value of zero, and the ToolStripProgressBar.Maximum property is typically set to a value indicating the completion of a task. For example, to display the progress properly when copying a group of files, the ToolStripProgressBar.Maximum property could be set to the total number of files to be copied. The ToolStripProgressBar.Value property represents the progress that the application has made toward completing the operation. Because the bar displayed in the control is a collection of blocks, the value displayed by the System.Windows.Forms.ToolStripProgressBar only approximates the ToolStripProgressBar.Value property's current value. Based on the size of the System.Windows.Forms.ToolStripProgressBar, the ToolStripProgressBar.Value property determines when to display the next block.

There are a number of ways to modify the value displayed by the System.Windows.Forms.ToolStripProgressBar other than changing the ToolStripProgressBar.Value property directly. You can use the ToolStripProgressBar.Step property to specify a specific value to increment the ToolStripProgressBar.Value property by, and then call the ToolStripProgressBar.PerformStep method to increment the value. To vary the increment value, you can use the ToolStripProgressBar.Increment(int) method and specify a value by which to increment the ToolStripProgressBar.Value property.

System.Windows.Forms.ToolStripProgressBar replaces the older System.Windows.Forms.ProgressBar control, which is nevertheless retained for backward compatibility.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0