Get file path for drag-n-drop file on Windows Explorer

后端 未结 2 614
执念已碎
执念已碎 2021-01-14 10:13

drag-n-drop is a pretty discussed topic in a lot sites (this too) and i found nice questions too, but no answer to this case.

I have a listView

2条回答
  •  北海茫月
    2021-01-14 11:16

    Think about it for a minute... if you know about drag and drop, then you'll know that the drag source worries about packaging up the data into the correct format and the drag target worries about retrieving the data in the correct format. Your problem is that your drag target is not in your WPF application and so there is very little that you can do as the data is dropped.

    A much better solution would be to implement your own basic file browser and then as part of your application, it would be far simpler to access the file path with the drag and drop operation. Either way, you've got a lot of work to do.

提交回复
热议问题