2012-04-20 107 views
0

我正在运行VB.NET程序并且出现错误“索引超出范围,必须是非负数,小于集合的大小参数名称:索引”

“Index was out参数名称:index“

我的代码如下所示。

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(新delegateoneArg(AddressOf onChangeEvent),WS)

+0

请显示'onChangeEvent'的代码。你的错误可能在那里。 – Steve 2012-04-20 12:09:30

回答

0

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

0

检查处理程序的定义onChangeEvent。您可能在那里访问过索引。 发布有关健壮答案的更多详细信息。

相关问题