Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim lines() As String = IO.File.ReadAllLines("path")
For i As Integer = 0 To lines.Length - 1
Dim line As String = lines(i)
'... process line ...
Dim progress As Integer = i * 100 \ lines.Length
Me.BackgroundWorker1.ReportProgress(progress)
Next
End Sub
Private Sub BackgroundWorker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles BackgroundWorker1.ProgressChanged
Me.ProgressBar1.Value = e.ProgressPercentage
End Sub