Progress Bar

  • Thread starter Thread starter Dino Buljubasic
  • Start date Start date
D

Dino Buljubasic

I have a form that has a progress bar to track opening of a file
document. Everything works excellent but the problem is when I want
to close the form while progress bar is running by clicking on X
(Close), my application crashes (I get window with the message that
"This program is not responding")

How do I fix this?

Thanks
 
Hi Dino,

You might try setting the pbar's maximum to the pbar's minimum in the form's
closing event, thus ending the pbar immediately before the form closes.

HTH,

Bernie Yaeger
 
to close the form while progress bar is running by clicking on X

What do you mean when you say "while the progress bar is running".
Progress bars do not run on their own. Perhaps you have a loop that is
running, that updates the progress bar?

If so, when closing the form, you must cause the loop to terminate. You
could use a boolean variable and check that variable inside the loop and if
its value it true, then exit the loop.

Please provide more detail on how you are updating the progress bar.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Back
Top