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...
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.
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.
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
Um, destlistbox.items.text:=sourcelistbox.items.text?
ReplyDeleteNo, 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.
ReplyDeleteIs there not a Listbox.Items.assign?
ReplyDeleteYes 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.
ReplyDeleteBah. Obvious things that don't work, don't you hate that?
ReplyDeleteLol! Hate a lot... Fact here is that TListBox isn't the same thing, it's another monster, obviously :)
ReplyDeleteWell, 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