Generics

  • Thread starter Thread starter Lou
  • Start date Start date
L

Lou

I am new at this. I have a class named cDvice
I want a collection of them so I do
Public Devices As New Generic.Dictionary(Of Integer, cDevice)

When I set one of the objects properties "Name" all the other objects "Name"
property change

Dim cd As cDevice = Devices(0)

cd.Name = "HELLO"

Now all the "cDevice" "Name" properties = "Hello" instead of just the first



When I do

For i = 0 To Devices.Count - 1

Debug.Print(Devices.Item(i).Name)

Next



they all print out "HELLO" when the others have different names?



-Lou
 
Back
Top