1
votes

I want to do drag and drop between 2 listboxes, but be able to select multiple items in one listbox, and drag those across to the other listbox. I need to make sure I don't accidentally "drop" them back on the source listbox. I did this in Borland Builder C++ successfully, but can only drag and drop one item at a time using the C# methods. I have gone through all the possibilities here, but none of them gives me a nudge in the right direction. In BCB the DragDrop method had references to the Sender and Source objects, which you could use to determine where the item came from. You could then iterate through the selected list and move them across from source to destination as needed. Is there anything similar available in C# using windows forms, not WPF?

I hope I make some sense in this question!

1

1 Answers

1
votes

Set the listbox property SelectionMode to SelectionMode.MultiExtended. To be able to select multiple items.

listBox.SelectionMode = SelectionMode.MultiExtended;