Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 5th, 2008, 05:47 AM
lee123's Avatar
Needs Regular Fix
 
Join Date: Feb 2007
Location: United States
Age: 37
Posts: 465
Default 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
Reply
  #2  
Old September 5th, 2008, 09:23 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 94
Default

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.
Reply
  #3  
Old September 5th, 2008, 01:17 PM
lee123's Avatar
Needs Regular Fix
 
Join Date: Feb 2007
Location: United States
Age: 37
Posts: 465
Default

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
Reply
  #4  
Old September 8th, 2008, 03:55 AM
lee123's Avatar
Needs Regular Fix
 
Join Date: Feb 2007
Location: United States
Age: 37
Posts: 465
Default

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
Reply
  #5  
Old September 25th, 2008, 11:01 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 94
Default

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.
Reply
  #6  
Old September 27th, 2008, 11:30 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 94
Default

I think soon I am going to post solution.
Reply
  #7  
Old September 30th, 2008, 10:56 AM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 94
Default

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.
Reply
  #8  
Old October 1st, 2008, 07:07 PM
smartchap's Avatar
Member
 
Join Date: Dec 2007
Posts: 94
Default

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.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles