retrieve key from collection

  • Thread starter Thread starter Albert
  • Start date Start date
A

Albert

Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert
 
If the item you are collecting has a way of storing the key, then you
have it. Otherwise, I've searched all over the collection object - it
isn't there.
The other option you have is to subclass your own collection object and
build in the functionality yourself.

T
 
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert

The general collection class does not really offer that funtionality.
If you need to work with both key and item, you likely would want to
use one of the specialized collections. Which one depends on what you
are wanting to accomplish.

Gene
 
If you use Generic.Sorted list or like, do it:

Dim strKey As String = colCollection.Keys(Index).ToString

[]s
Cesar
 
Back
Top