Results 1 to 3 of 3

Thread: Collection Keys

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253
    I want to create a simple collection such as:
    Code:
    Dim colNew as New Collection
    colNew.Add "Text", "Key"
    I want to change the key value in the collection like
    you can for the ListView control.
    Code:
    ListView.ListItems(1).Key = "Key"
    ListView.ListItems("Key") = "Text"
    It seems that once you put the key into the collection,
    there is no way to modify it. Does anyone know of a way?
    Always looking for a better and faster way!

  2. #2
    Guest
    One way you *might* be able to do this is to add the text to the collection a second time with the new key then delete the old key, which would in effect give you the same text with a changed key.

    Paul

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Orlando, FL
    Posts
    253

    Thumbs up

    Yup! I agree. I thought of that also and it looks
    like that is the way to go...
    Code:
    Dim objItem as clsItems
    
    Set objItem = New clsItems
    Set objItem = colItems("OrigionalKey")
    colItems.Add objItem, "NewKey"
    colItems.Remove "OrigionalKey"
    Or something along that line. Thanks!
    Always looking for a better and faster way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width