I have a class Chair in my system. Now I want to deal with typed collections of chairs, so I have defined a ColChair class, with a collection-like interface: Add, Remove, Item and Count. I have made Item the defaut property. The problem is I can't iterate the collection with a "For Each" construct; it crashes at run-time:
Dim col As New ColChair
'fill col with Chair objects.
Dim ch As Chair
For Each ch In col 'this line crashes.
'do something with ch.