我只是看不到我在这里做错了什么,因为我已经在我的后台工作人员中实现了一个进度条,它不再只运行一次(在某些情况下,我已经看到 foror 循环中的编码运行了 6 次)
我的编码:-
My progress bar max value is set to 10.
‘ BGWorker Do Work Event
For i As Integer = 1 To 2
‘ Run code 1
Next
For i As Integer = 2 To 3
‘ Run code 2
Next
For i As Integer = 3 To 4
‘ Run code 3
Next
For i As Integer = 4 To 5
‘ Run code 4
Next
For i As Integer = 5 To 6
‘ Run code 5
Next
For i As Integer = 6 To 8
‘ Run code 6
Next
For i As Integer = 8 To 9
‘ Run code 7
Next
‘ BGWorker Progress changed event
Me.Progressbar1.Value = e.ProgressPercentage
Me.label1.Text = String.Format("{0} % Completed", e.ProgressPercentage * 10)
我真的很感激任何帮助,因为我只是不明白为什么我在循环中的编码不应该只运行一次。