People, it could be a very noob question, but how do I duplicate the items of a TListBox? Can't use Assign and don´t want to duplicate a TListBoxItem for the new listbox...

Comments

  1. Um, destlistbox.items.text:=sourcelistbox.items.text?

    ReplyDelete
  2. No, need clone items, and includes Details, Text and also the Tag attribute, it's more deep than simple strings. With TListBox from VLC I would use Assign to clone data.

    ReplyDelete
  3. Is there not a Listbox.Items.assign?

    ReplyDelete
  4. Yes Paul, it was my very first attempt. Worked, but copied just the single strings. I think I will have to do a loop (!) or multiple assignment, if possible.

    ReplyDelete
  5. Bah. Obvious things that don't work, don't you hate that?

    ReplyDelete
  6. Lol! Hate a lot... Fact here is that TListBox isn't the same thing, it's another monster, obviously :)

    ReplyDelete
  7. Well, I could have told you that. Provided we are talking about firemonkey, of course. It is nothing like the vcl listbox - you know you can style the list items so they can contain complex designs - containing any control you like

    ReplyDelete

Post a Comment