Vb net progress bar not updating
We have had a few questions on the board in recent times asking about the best way to show the progress of a long running process; such as file reading of a HUGE file.
If you have a file with tens or hundreds of thousands of lines, or datasets which may have millions of records, it is going to take some time to process.
Hi, I have some code that runs a long function and therefore I need a progress bar to show that something is actually going on. Value = Round((Rec Number / Max Size) * 100) but the last line returns an error: Property is write-only... Also, in you can throw application.doevents to make the screen update, is there a similar function in Access or do I not even need it?
So in the code (which is not the code behind the progress bar form) I have this: Forms! Caption = "Updating weekly demand rows - " & Rec Number & "/" & Max Size Forms! tnx ~j Cannot tell you why that field would be read only, I generally use labels and update the Caption property rather than setting the value of a textbox (is PB a textbox)?
You can simply use: Do Events To allow a pause in order for windows to perform a variety of actions. and if you want a more robust progress bar, check out me article and the associated example database.
If our progress bar has 100 ticks, we divide the file length by 100.
So each time we process past the milestone, we update the progress bar.
Update Progress() is in control of updating our progress bar and our label.