我有一个ProgressBar
名为ProgressBar1
. 我需要它来显示For Each
循环的进度。它逐步完成,但最后我得到了这个错误“ Additional information: Value of '102' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.
”无论我做什么,我都无法让决赛ProgressBar1.Value
与ProgressBar1.Value
.
这是我到目前为止的代码:
Public Shared tickerArray() As String = {"GOOG", "V", "AAPL", "BBBY", "AMZN", "DISCA"}
ProgressBar1.Maximum = (100 / tickerArray.Length) * tickerArray.Length
ProgressBar1.Show()
For Each tickerValue In tickerArray
Historical_Stock_Prices.addBulk_Historical_Stock_Prices(tickerValue, tblName)
ProgressBar1.Value += (100 / tickerArray.Length)
Next tickerValue