| | |
progress bar problem in vb
![]() |
•
•
Join Date: Oct 2005
Posts: 51
Reputation:
Solved Threads: 0
hi,
i am using a progress bar in a conversion program in conversion process progress bar is showing the progress of conversion , but i am using a timer increment for increase the progress bar , but when file is big due to timer is showing the process has been completed but actually file conversion is not completed .Is at any method is there which can calculate the first file size and according to this file size process gets incerement .
i am using a progress bar in a conversion program in conversion process progress bar is showing the progress of conversion , but i am using a timer increment for increase the progress bar , but when file is big due to timer is showing the process has been completed but actually file conversion is not completed .Is at any method is there which can calculate the first file size and according to this file size process gets incerement .
•
•
Join Date: Nov 2005
Posts: 134
Reputation:
Solved Threads: 10
Hi jto,
If I understand correctly you are loading a file and want the progress bar to indicate how far you have actually come in the load process - correct?
If so you could use the FileLen(<path>) function to get the length of the file initially. You store this in the MaxValue of the progress bar and keep a 'counter' to track how much of the file you have read so far by adding the length of the data you just read to it every time you do an input. Something like this: Please note that I have NOT tested this code.
Hope this helps
Happy coding
Yomet
If I understand correctly you are loading a file and want the progress bar to indicate how far you have actually come in the load process - correct?
If so you could use the FileLen(<path>) function to get the length of the file initially. You store this in the MaxValue of the progress bar and keep a 'counter' to track how much of the file you have read so far by adding the length of the data you just read to it every time you do an input. Something like this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim BytesRead As Long Dim InputLine As String ProgressBar.MinValue = 0 ProgressBar.MaxValue = FileLen(<path>) Open <path> For Input As #1 While Not EOF(1) LineInput #1, InputLine BytesRead = BytesRead + Len(InputLine) ProgressBar.Value = BytesRead Wend Close #1
Hope this helps
Happy coding
Yomet
![]() |
Similar Threads
- progress bar (Visual Basic 4 / 5 / 6)
- Visual Basic Progress bar?! (Visual Basic 4 / 5 / 6)
- an animated STATUS BAR, or PROGRESS BAR, (Community Introductions)
- Javascript Progress Bar flickers (JavaScript / DHTML / AJAX)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Setting a range
- Next Thread: Need help with my database
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






