469,322 Members | 1,418 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

Progressbar

lee123
556 512MB
Can some one tell me how i can add a progressbar to my project. Because right know i am using a animation picture. the progressbar i want to add has labels that tells how long it will take to finish and elapsed time.

lee123
Sep 5 '08 #1
7 1356
smartchap
236 100+
I think first of all add a progress bar control to your project then calculate the total time to be taken to complete the required job and set it to maximum value of the progress bar. Now calculate elapsed time from start time as system time at start and (current system time - start time) as elapsed time which will be the current value of the progress bar. So elapsed time and remaining time will be displayed on progress bar.
If you have any other query please post the code to understand the problem exactly and give solution.

Always Believe in God.
Sep 5 '08 #2
lee123
556 512MB
Ok I want to stick the code in this button if you can figure out how let me know

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdCopy_Click()
  2. On Error Resume Next
  3. Animation1.Open "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos\filecopy.avi"
  4. Animation1.Play
  5. Dim fso As New Scripting.FileSystemObject
  6. Dim fld As Folder
  7. Set fld = fso.GetFolder(txtSourceOfFolder)
  8. fld.Copy (txtDestinationOfFile)
  9. Animation1.Stop
  10. Animation1.Visible = False
  11. MsgBox "Transfer Completed!", , "Transfer Is Completed"
  12. Me.Refresh
  13. cmdExit.Enabled = True
  14. txtSourceOfFolder.Text = ""
  15. txtDestinationOfFile.Text = ""
  16. txtNameOfFolder.SetFocus
  17. End Sub
i have made this program and i don't know where or how i can stick a progressbar in it

lee123
Sep 5 '08 #3
lee123
556 512MB
How Can I stick A For..Next in this like

Expand|Select|Wrap|Line Numbers
  1. For P = 1 to 100
  2.        Progressbar1.value = P
  3.               For x = 1 to 100               
  4.        Next x
  5. Next P
or something like that.

where do i stick the code, i have never worked with "for...next" before don't know how it works..just seen on a web page.

lee123
Sep 8 '08 #4
smartchap
236 100+
How to add Animation is not known to me. However I will try to find out and add progressbar to it. The code for progress bar u have written will only increase the value of progressbar irrespetive of file size or time to be taken.
Sep 25 '08 #5
smartchap
236 100+
I think soon I am going to post solution.
Sep 27 '08 #6
smartchap
236 100+
Dear lee
Please see my submission at Planet-source-code named CopyFolder_PBar with following URL:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=71156&lngWId=1

Certainly it will give you idea about using Progress Bar in your project.
Sep 30 '08 #7
smartchap
236 100+
Dear lee
I think u must have placed ProgressBar in ur project with the help of my code at PSC. If it helped u please do vote my submission at PSC (by scrolling that window see voting... Excellent,etc.). Also do paste ur completed code here.
Oct 1 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Thomas Kehl | last post: by
3 posts views Thread by Steve Teeples | last post: by
2 posts views Thread by jez123456 | last post: by
8 posts views Thread by needin4mation | last post: by
3 posts views Thread by Mitchell Vincent | last post: by
1 post views Thread by nobody | last post: by
2 posts views Thread by =?Utf-8?B?QWFyb24=?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.