Could someone explain what exactly a collection object is in the context of OO VB? I understand what classes do, but I don't quite understand what collections are. Could someone enlighten me?
"A Collection object is an ordered set of items that can be referred to as a unit. The Collection object provides a convenient way to refer to a related group of items as a single object. The items, or members, in a collection need only be related by the fact that they exist in the collection. Members of a collection don't have to share the same data type."
A common example is a form's Controls collection. It can contain textboxes, labels, frames, images, etc.. All are different, and may operate separatly, but are related because they are a control, or object, on the form and therefore in the collection.
You can also create your own collection in order to refer to any group of objects at once or conveniently (via a loop).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.