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!

Displaying Progress of File Copy???

Status
Not open for further replies.

slinko

Programmer
Jan 21, 2001
14
0
0
US
Does anyone know how to display the progress of a file copy in a progress bar. I am copying a file to the floppy drive and was wanting to display a progress bar to indicate the progress of the copy. I was trying to work something out by finding the file size and working from 0 to the total file size, but kind of got stuck. I am using a file system object to copy the file, but if I could use another method that would give me the progress of the copy, I would like to know how to use it. Just wanting to see if anyone had any ideas to make it simple. Thanks in advance for any tips or tricks.
 
Use the Value Property With the Min and Max Properties
to Show Progress:
To show progress in an operation, the Value property
is continually incremented until a maximum — defined
by the Max property — is reached. Thus the number of
chunks displayed by the controls is always a ratio of
the Value property to the Min and Max properties. For
example, if the Min property is set to 1, and the Max
property is set to 100, a Value property of 50 will
cause the control to display 50 percent of the chunks.

Set the Max Property to a Known Limit :
To program the ProgressBar, you must have a limit to
which the Value property will climb. For example, if
you are performing downloading a file, and your
application can determine how large the files is in
kilobytes, you can set the Max property to that
number. As the file is downloaded, your application
must also have some way of determining how many
kilobytes have been downloaded; set the Value property
to that number.


Hope this will help. Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top