Progress Bar

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
 
B

Bernie Yaeger

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
 
C

Chris Dunaway

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top