I have a class called 'Document'.
I can declare an array of it as such:
Private Docs() As Document
or I can define a collection:
Private Docs As New Collection
If I use an array, when I am writing code
VB recognises that every element will have the properties, methods and events that Document has, which I need, but I have to control all the redimensioning when I add or remove a document.
If I use a collection, all the adding and removing is done automatically, but
VB does not recognise the properties, methods and events of Document as the collection can contain any object, not just a Document.
Is there any way to get the best of both worlds?
Ideally it would be nice to be able to do something like this:
Private Docs As New Collection(Of Document)
but
VB doesn't support this.