AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

Using the Progress Bar to measure action

In creating a program recently, I wanted my VB5 progress bar to show action, rather than percent complete. So I came up with a technique where I initialize:

ProgressBar1.Max=1000

Then in a later loop where I am displaying progress as I move through a file, my code says:

ProgressBar1.Value=X mod 1000

X is a count of records read from a file, which I have no way of knowing the number of records beforehand. This way, using MOD,  I never have an out of range error in setting the progress bar value.  Once the number of records is over 1000, then using MOD, the progressbar is reset to 0.

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/