VB. Net Collections and the Key !!!
Posted on 2004-09-23
I'm having some smal problems with a collection in VB .Net .....
Public Class Reports
Public Sub New()
Public Function Add(ByVal objNewItem As Report) As Report
Default Public Property Item(ByVal iIndex As Integer) As Report
Set(ByVal ReportObjectToBeAdded As Report)
MyBase.InnerList.Item(iIndex) = ReportObjectToBeAdded
Public Sub Remove(ByVal iIndex)
I know there isn't much going on here, but i just wanted to illustrate what i mean.
In VB 6.0 you could add a key (i think, it might have been called an index), when you are adding an item to a collection, and then from then on you could retrieve that object from the collection by using that Key. (Although you couldn't retrieve the key once it has been set).
This line MyBase.InnerList.Add(objNewItem) does return a index, which i think is the same thing, but i want to be able to set it ??
Is this possible ?? or have i got the whole thing upside down ??
Thanks in Advance.