Results 1 to 7 of 7

Thread: ProgressBar [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526

    ProgressBar [RESOLVED]

    Know how display and show a ProgressBar working, but want it to show while other tasks are being done.

    Specifically, am reading data from a Notepad file and writing parsed info to an Excel spreadsheet. How do I show the ProgressBar functioning while the reading and writing is going on?
    Last edited by doofusboy; Apr 22nd, 2003 at 09:17 AM.
    Do canibals not eat clowns because they taste funny?

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    depends a bit on how your code is built up....

    VB Code:
    1. 'start loop
    2. 'read from file
    3. 'update progress
    4. 'doevents
    5. 'write to file
    6. 'update progress
    7. 'doevents
    8. 'end loop

    something along those lines maybe
    -= a peet post =-

  3. #3

    Thread Starter
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    Aha.......so you're saying it depends on where my

    ProgressBar1.Value = i
    DoEvents


    statements are made in my code?


    And do I need to include a "Do Events" every time I update the ProgressBar1.Value?
    Do canibals not eat clowns because they taste funny?

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    you have to "feel your way" when it comes to how often you want to do the doevents

    in order for the pb to view its updates, u will probably need it for each loop...
    -= a peet post =-

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    the doevents will slow down your code though
    -= a peet post =-

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You can probably just use a ProgressBar1.Refresh call instead of calling DoEvents. But the prograssbar must somehow get processor time to redraw itself.

  7. #7

    Thread Starter
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    Issue resolved by updating ProgressBar1.Value during other processing .....and ProgressBar1.Refresh was just the ticket! ....works like a charm

    Thanks to all who responded.
    Do canibals not eat clowns because they taste funny?

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