Progress Bar progress

  • Thread starter Dino Buljubasic
  • Start date
D

Dino Buljubasic

Hi,

I have a separate form that displays a progress bar when user tries to
open a file (an Image, a PDF document or so stored in a database) from
my application.

When user clicks on a button to view the file, the form pops up and
displays progress bar and calculated percentage loaded so far

How can I give the user oportunity to cancell the whole process ?
(say file is too large and user does not want to wait for it to open
for several minutes)

Thank you
 
S

scorpion53061

Place the process that opens the file in a separate thread. If the
button to cancel the opening is clicked, it then should tell that thread
to die.
 
G

Guest

You can add a Property to the Progress Form called something like "Cancel"
and add a cancel button to the progress Form. If the cancel button is
clicked, set the cancel property to True. You can then check this property
everytime you update the progress bar and if it's true, then stop the file
reading process.
 

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

Top