Listboxes: move (rather than copy) an item from one listbox to another

I have created two list boxes. I have written code to drag an item from first listbox to the second list box. This works. However, a copy of the item is kept in the source listbox i.e. it copies. I rather wish to move from one listbox to another. Could you please advice me.

Many thanks in advance.

add to the one you drag to
remove it from the one you dragged it from

Yes, add to the listbox I dragged to (target) and remove from the listbox I dragged from (source).

Code on the source:

drag.Text = Me.List(row)
Return True // allow the drag

Code on source:




you never remove the item from the original list when its dropped on the other list

listboxes hold their own data
and each has a copy
so to “move” you copy the data to the destination and remove from the original
you’re not removing it from the original

Thank you! This is very helpful to know.

The issue I have is that in my destination listbox I have ‘DragrReorderRows’ and ‘DropObject’. How can I inactivate 'DropObject" when i am active ‘DragReorderRows’.

in drag reorder rows set a boolean and in drop object check that boolean

Thanks. How do I do that? I am relatively new. Thanks

Please read the Introduction to Programming with Xojo books. They are free and there for a reason.

managed to get a workable solution along what you suggested. Appreciate your guidance. Bw