0

我正在尝试使用数组中的项目构建组合框,但出现此错误:

这是我的代码:

Private Sub frmInventory_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim InvArray As Array
    InvArray = Inventory.BuildInvArray()
    Option Strict Off
    For i As Integer = 0 To 5
        cmbSystem.Items.Add(InvArray(i,1))
    Next
End Sub
4

1 回答 1

0

它可以通过使用来完成Array.GetValue

Private Sub frmInventory_Load(sender As Object, e As EventArgs) Handles Me.Load
    Dim InvArray As Array
    InvArray = Inventory.BuildInvArray()
    For i As Integer = 0 To 5
        cmbSystem.Items.Add(InvArray.GetValue(i, 1))
    Next
End Sub
于 2015-11-11T22:41:20.530 回答