Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progress Bar

Status
Not open for further replies.

espuelas

Technical User
Aug 22, 2001
6
BE
Dear All,

I would like to associate a Progress Bar with the process of copying files from one drive to the other so that the operator can follow how far he is in the process.

Can anyone give me some tips ?

It seems that the use of progress bars is not very well documented... or where could I find practical informations ?

Thank you in advance.

Espuelas
 
Greetings--
Yes you are correct there is very little documentation regarding Native Windows Controls and what is there is confusing.
Here goes. In design mode select view/toolbars/object so that you can use the object toolbar. Then select the progress bar Icon and drag it to where you wish to see it on the form. Name this object "progress". This is the progress bar.

Now-- Wherever you have setup the code for copying files you will need to insert this code (or something like it):

progress.pos=Longint(0);/SET THE BAR TO ZERO

progress.setrangeandstep ;/SET YOUR VALUES
(Longint(0),Longint(8),Longint(1))
progress.stepit()

progress.stepit()

progress.stepit()

progress.stepit()

progress.stepit()

progress.stepit()

progress.stepit()

progress.stepit()
progress.pos=Longint(0) ;/ SET THE BAR BACK TO ZERO

The "progress.stepit()" code tells the bar to go to the next step in the sequence. So insert whatever process code you have in-between the steps. You will need to determine the exact range you need depending on your application. Unfortunately this approach will not tell you how much of the file itself has been copied. If anyone out there knows how to do that please reply.
Hope this helps
 
Dear Eviltwin,

Thanks a lot, it will help for beginning...

Best regards.

espuelas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top