How to create a “drag and drop target” in a winforms list that shows if the source falls before or after the target

I have a user control that hosts a winforms list. I am reassembling the items in the list using drag and drop. I realized that I needed a “target line” for drag and drop, which shows if I drop before or after the target.

Any suggestions. I am open to suggestions. I did not get on the list. I can use a different winforms control (the easier, the better), and I also got a license to manage teleform teleforms (a couple of versions back). RadListBox does not bind data to my biz object, so I went with the winforms version. But maybe another rad control will give me this out of the box.

For the record, I prefer sticking to the winforms list if it can work.

If I need to implement this behavior, I have code samples or suggestions on how to do this. I would not know where to start?

+3
source share
2 answers

See how one person provided a visual hint about where the drag and drop operation will be performed on the ListBox:

Drag ListBox

See his class VisualCue.

+1
source

I think you could just use ListView for this instead of ListBox.

0
source

Source: https://habr.com/ru/post/1717449/


All Articles