"Index was out of range. Must be non-negative and less than the size of the collection. Parameter n



我正在运行一个 VB.NET 程序,但错误为

"指数超出范围。必须是非负数且小于集合的大小。参数名称:索引"

我的代码如下所示。

  If Status.InvokeRequired Then
        Try
            Status.Invoke(New delegateoneArg(AddressOf onChangeEvent), ws)
            Catch ex As DivideByZeroException
            MessageBox.Show(ex.Message)
        End Try
    Else
        onChangeEvent(ws)
    End If

我有错误...Status.Invoke(New delegateoneArg(AddressOf onChangeEvent), ws)

检查状态对象的Invoke方法。 这是访问具有超出范围值的索引。

检查onChangeEvent处理程序的定义。您可能已经访问了那里的索引。发布更多详细信息以获得可靠的答案。

相关内容

最新更新