问题
It seemed farily straight forward learning how to process files dropped onto a ListView control. But I can't seem to find anything about dragging files FROM the ListView control.
To complicate things, the ListView control is displaying an FTP directory. So I don't want to actually download the files until I confirm they have been dropped on a window that will accept them.
I know that it's possible to provide the actual data for a drag-and-drop operation only after the drop has taken place. But I'm having trouble finding anything about doing this from a ListView control using C# and Webforms.
Any tips?
Thanks!
回答1:
The best link I've found on this issue yet is at Delay's Blog.
He starts by saying "This code [...] and is specifically targeted at scenarios where an application wants to allow the user to drag an element to a folder and create a file (or files) dynamically on the drop/paste. The standard .NET APIs for drag-and-drop don't support this scenario [...]"
Wow, that's the answer. For all the problems I have with C# and .NET, I run into yet another obstacle. He does have some code to workaround this. I'll be checking that out.
来源:https://stackoverflow.com/questions/4294882/drag-files-from-listview