索引超出了数组视觉基础的范围

时间:2015-04-23 02:30:12

标签: arrays indexing bounds

我遇到这个错误,我的索引超出了数组的范围 有人可以帮我看一下我的代码吗?

Private Sub picList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picList.Click
    frmList.Show()
    frmList.lstShow.Items.Clear()
    Dim fmtStr As String = "{0,-5}{1,-10}{2,-15}{3,-20}{4,-25}"
    With frmList.lstShow.Items
        .Add(String.Format(fmtStr, "University Name", "Abbreviation", "State", "Accredited Year", "Total Students"))
        For A = 0 To N - 1
            .Add(String.Format(fmtStr, Name(A), Abbreviation(A), State(A), Accredited(A), Total(A)))
        Next
        .Add(String.Format(fmtStr, "", "", "", "", ""))
        .Add("Total of " & N & " Universities.")
    End With
End Sub

0 个答案:

没有答案