Results 1 to 4 of 4

Thread: ProgressBar

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    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.


  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    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).]

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    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
    AIM: RYoni69

  4. #4
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width