-
Feb 8th, 2012, 12:19 PM
#1
Thread Starter
Addicted Member
Help with progressbar and counter label
here's my code:
Code:
Private Sub btnBeginScan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBeginScan.Click
Dim db As New byrndbDataContext
For Each pdffile In strPDFFiles
strImagesScanned += 1
pbScan.Value += 1
lbImagesScanned.Text = strImagesScanned
Dim info As New FileInfo(pdffile)
Next
For Each tiffile In strTIFFiles
strImagesScanned += 1
pbScan.Value += 1
lbImagesScanned.Text = strImagesScanned
Dim info As New FileInfo(tiffile)
Next
lbNewImages.Text = strNewImages
End Sub
The progressbar runs perfectly, but the lbImagesScanned.Text isn't updated until all the scans are completed. Please advice.
-
Feb 8th, 2012, 12:57 PM
#2
Re: Help with progressbar and counter label
You are updating the label after the scans have completed so what do you expect? You can either place lbNewImages.Text = strNewImages inside each for loop or create it's own subroutine and call the update when desired. I would personal use the second option.
edit* Teach me to glance quickly.
Have you tired using application.doevents?
Last edited by ident; Feb 8th, 2012 at 01:04 PM.
-
Feb 9th, 2012, 11:27 AM
#3
Thread Starter
Addicted Member
Re: Help with progressbar and counter label
I should have taken out the lbNewImages.Text = strNewImages line, it's not the label in which I'm talking about. I'm talking about the lbImagesScanned.Text = strImagesScanned line, it is inside the for each.
That's why I'm confussed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|