ProgressBar


The ProgressBar control lets a program display a visible indication of its progress during a long task. As the task proceeds, the ProgressBar fills in from the left to the right. Ideally, the ProgressBar is completely full just as the task finishes.

The control’s Minimum and Maximum properties determine the integers over which the ProgressBar control’s values will range. When the control’s Value property equals its Minimum property, the control is completely blank. When its Value property equals its Maximum property, the control is completely filled.

By default, Minimum and Maximum are set to 0 and 100, respectively, so the Value property indicates the percentage of the task that is complete. However, you can set Minimum and Maximum to any values that make sense for the application. For example, if a program must back up some data by copying 173 files from one directory to another, you could set these properties to 0 and 173. As it copies each file, the program would set the ProgressBar control’s Value property to the number of files it has copied.

Instead of setting the control’s Value property to indicate the task’s status, you can set the Step property to indicate how much the control should update at each step. Then you can call the ProgressBar control’s PerformStep method to increment the Value by that amount.

Note that the Minimum, Maximum, Value, and Step properties are all integers. If the value you want to display has some other data type (such as Double or TimeSpan), you must convert the values into integers before you use them with the ProgressBar.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net