C# Drag & drop from listbox to treeview

前端 未结 2 1185
梦毁少年i
梦毁少年i 2020-12-09 11:50

I have a winform with a listbox and a treeview.

Once my listbox is filled with items, I want to drag them (multiple or single) from the listbox and drop them in a n

2条回答
  •  误落风尘
    2020-12-09 12:44

    You want to use the GetItemAt(Point point) function to translate X,Y location to the listview item.

    Here's quite good article about it: Drag and Drop Using C#.

    To make the item being dragged visible while dragging, you need to use COM ImageList, which is well described in the following article Custom Drag-Drop Images Using ImageLists.

提交回复
热议问题