Click to See Complete Forum and Search --> : Collection of objects


khun
August 19th, 2002, 06:56 AM
Just a quick one, I am a beginner to .NET but not to VB programming:

Where are the Collections nowadays? If I want to handle an entire group of, say, persons, then I should need some kind of Collection class to group together the instances of the cPerson classes, shouldn't I? But how do I build a collection class in VB.NET?


Thanks,


Peter

DSJ
August 19th, 2002, 09:35 AM
You should inherit from collection base and then add ADD/REMOVE, etc. methods to stongly type them to a Person. There's a "walkthrough" example in the help files.

Public Class PersonCollection
Inherits System.Collections.CollectionBase
End Class

khun
August 20th, 2002, 02:27 AM
Hmmm... That sounds reasonable. Thanks!

Peter