我只是不明白我在做什麼錯在這裏,因爲我實現了一個進度條設置爲我的背景工人不再只運行一次(在某些情況下,我所看到的編碼在福爾循環運行6次)進度條與後臺工作第2部分
我的編碼中: -
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)
,我只是不能明白爲什麼在循環中我的編碼不應該只運行一次,我真的很感激任何幫助。
你不顯示調用報告進度,等你的密碼,當你說「我已經看到了福爾循環中的編碼運行6次)「,你的意思是在調試器中?在進度條中?哪裏? –
您是否正在報告進度?那些下一個對於你的帖子對我來說毫無意義。發佈您的背景工作者。 – Paparazzi