I wrote a class which imports System.Collections.ObjectModel. For the management of the collection, I've written:
Default Public ReadOnly Property Item(ByVal vntIndexKey As Integer) As ItemType
Get
Return CType(mCol.Item(vntIndexKey), ItemType)
End Get
End Property
Then when i was debugging, I was told:
"Index was out of range. Must be non-negative and less than the size of the collection."
The "ItemType" is always being an object, and during the debug, I can see that vntIndexKey=1.
Could someone tell me why?