here's a simple example: (since everything is an object in .net, you don't
have to use variant enumeration but can strong type it instead)
'=============================================
sub main()
dim p as new parent
dim c as child
for each c in p.children
console.writeline("Index: " & c.index)
next
end sub
class parent
private myKids() as child
sub new()
redim myKids(2)
dim i as integer
for i = 0 to 2
myKids(i) = new child(i)
next
end sub
readonly property children() as child()
get
return myKids()
end get
end property
end class
class child
private myIndex as integer
sub new(byval index as integer)
myIndex = index
end sub
readonly property index() as integer
get
myIndex
end get
end property
end class
'=============================================
hth,
steve
"Scott Meddows" <sc******************@tsged.com> wrote in message
news:O8**************@TK2MSFTNGP12.phx.gbl...
How do I write an interface to a class that represents a group of objects
like I would the controls object?
i.e.
I want to do this....
Dim simpleObject as new MyObjectGroup
Dim anObject as AnObjectInTheGroup
For each anObject in simpleObject
' Blah
Next
I remember in VB 6 (pauses for cringes), you implemented a COM interface.
How do you do this in .NET?
Thanks
Scott