Thanks... Funny thing is once I rebooted and tried that same code again, it worked fine... Go Figure huh....
Anyways I didn't want to start a new thread about the same topic so I want to extend on this question and add a second part to it..
Now that I got the Iteration working, I'm faced with a new problem.. I am not just storing one special class in the hashtable but instead I have 3 different classes I am storing in the hashtable..
Say I have:
Class1
Class2
Class3
Now there is no logical order they are stored in the hashtable.. so I need to know how to identify the class that I am casting when iterating through a hashtable...
so how do I identify this:
The di.Value can be one of 3 classes so I need to figure out what "o" should be before I can cast "di.value" to it, how do I do this?Code:For Each di In ht o = DirectCast(di.Value, clsTest) With Me.ListBox1 .Items.Add(o.MyID) End With Next




Reply With Quote