0

我的对话框上有这个代码:

Private Sub DAddSupplier_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim objProveedores As New AR.CMP.ControlCatalogo()
    Dim dvClases, dvEstados As DataView

    dvClases = objProveedores.ListarClasesProveedor()

    If dvClases IsNot Nothing AndAlso dvClases.Count > 0 Then

        For i As Integer = 0 To dvClases.Count
            cmbClase.Items.Add(dvClases(i)("Class"))
        Next

    End If
    'reach until here the debugger 
    dvEstados = objProveedores.ListarEstadosProveedor()

    If dvEstados IsNot Nothing AndAlso dvEstados.Count > 0 Then

        For j As Integer = 0 To dvEstados.Count
            cmbEstado.Items.Add(dvEstados(j)("Name"))
        Next

    End If

End Sub

但只有到达第一个代码块,除非第一个被评论,否则它会被忽略,为什么会出现这种行为?

4

1 回答 1

0

只需将它放在initializationComponent调用之后,它就会工作

于 2013-11-26T13:52:52.267 回答