Progressbar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    Progressbar

    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
  • smartchap
    New Member
    • Dec 2007
    • 236

    #2
    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.

    Comment

    • lee123
      Contributor
      • Feb 2007
      • 556

      #3
      Ok I want to stick the code in this button if you can figure out how let me know

      Code:
      Private Sub cmdCopy_Click()
      On Error Resume Next
      Animation1.Open "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos\filecopy.avi"
      Animation1.Play
      Dim fso As New Scripting.FileSystemObject
      Dim fld As Folder
      Set fld = fso.GetFolder(txtSourceOfFolder)
      fld.Copy (txtDestinationOfFile)
      Animation1.Stop
      Animation1.Visible = False
      MsgBox "Transfer Completed!", , "Transfer Is Completed"
      Me.Refresh
      cmdExit.Enabled = True
      txtSourceOfFolder.Text = ""
      txtDestinationOfFile.Text = ""
      txtNameOfFolder.SetFocus
      End Sub
      i have made this program and i don't know where or how i can stick a progressbar in it

      lee123

      Comment

      • lee123
        Contributor
        • Feb 2007
        • 556

        #4
        How Can I stick A For..Next in this like

        Code:
        For P = 1 to 100
               Progressbar1.value = P
                      For x = 1 to 100               
               Next x
        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

        Comment

        • smartchap
          New Member
          • Dec 2007
          • 236

          #5
          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.

          Comment

          • smartchap
            New Member
            • Dec 2007
            • 236

            #6
            I think soon I am going to post solution.

            Comment

            • smartchap
              New Member
              • Dec 2007
              • 236

              #7
              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?tx tCodeId=71156&l ngWId=1

              Certainly it will give you idea about using Progress Bar in your project.

              Comment

              • smartchap
                New Member
                • Dec 2007
                • 236

                #8
                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.

                Comment

                Working...