0

I have added a reference (component) into a project. I need to create a control array using dictionary and I want to add the item as that reference component. How to add the item as that component and call the constuctor of dictionary .I have code like

Private Sub InitializeComponent()
        Me.Add(0, New WImage)
End Sub


Public Sub Add(ByVal new_key As Integer, ByVal new_AxWImageArray As WImage) 
    Dictionary.Add(new_key, new_AxWImageArray)
End Sub


Default Public Property Item(ByVal key As Integer) As WImage
    Get

        Return DirectCast(Dictionary.Item(key), WImage)

        ' Return CType(_mydictionary.IndexOf(key, Values), WImage)

    End Get
    Set(ByVal Value As WImage)
        Dictionary.Item(key) = Value
    End Set

End Property

I get Object reference error at Me.Add(0, New WImage) of InitializeComponent().

4

0 回答 0