PDA

Click to See Complete Forum and Search --> : ProgressBar


QWERTY
Dec 8th, 1999, 03:12 AM
I wrote a program, which opens some files in Excel (to be more specific 7 files), takes some info from each file, and puts it in the 8th file (also created from my app). I had no problems with that, but now I need to put something like ProgressBar kind of thing, so the user knows how long it will take to finish the process. I know how to use ProgressBar, but how can I find out how long will it take to finish the process???????
Thanks for your reply.


------------------
Visual Basic Programmer
------------------
PolComSoft
You will hear a lot about it.

MartinLiss
Dec 8th, 1999, 03:28 AM
A progress bar is usually set up to indicate the status of some action and not how long it takes. So what you could do would define a constant equal to 14.28 (= 100/7) and each time you are done with one of your 7 files, update ProgressBar1.Value = ProgressBar1.Value + YourConstant. If there are some spots within each file manipulation that you can get at, you could add more, finer, updates to the progress bar and make its visual change smoother.

------------------
Marty

[This message has been edited by MartinLiss (edited 12-08-1999).]

Yonatan
Dec 8th, 1999, 04:02 AM
Why so much calculation?

ProgressBar1.Min = 0
ProgressBar1.Max = 7
ProgressBar1.Value = <Number of files completed>

------------------
Yonatan
Teenage Programmer
E-Mail: RZvika@netvision.net.il
ICQ: 19552879 (http://www.icq.com/19552879)
AIM: RYoni69

MicahCarrick
Dec 8th, 1999, 01:50 PM
If you want your user to know what ther percentage complete is you could use:

'Set the percentage of the progress bat
'to the label
lblPercent = Format(((pg.Max - pg.Min) / 100) * pg.Value, 0)


And for time, just have a timer control that increments a variable every second, then when one file is completed (or whatever you want to use as a reference) you can say estimated time remaining is 6 * that variable.

------------------
Micah Carrick
Ordinary joe, only not named joe.
http://micah.carrick.com
micah@carrick.com
ICQ: 53480225