3
votes

I have a query about drag-drop in C# using .NET.

My issue is with remote files. I have a list of remote files which the user can drag into an explorer window (desktop, etc). When such a drag occurs I want to be able to download the file and write it to the drop location.

The normal method of dragging files:

private void StartDragDrop(string FileToDrag)
{
MyControl.DoDragDrop(new DataObject(DataFormats.FileDrop, FileToDrag), DragDropEffects.Copy);
}

...does not suit my needs as I will not have the file data to populate the drag-drop object until after the DROP.

I have seen this functionality in many FTP clients and such.

Thanks in advance wizards.

1
I have found the link below, but there must be an easier way to do it than that... codeproject.com/KB/dotnet/DataObjectEx.aspxLloyd Powell
There is no simpler way, .net support for shell drag and drop is limited, so if you want to go beyond the limits you must do all the low-level interoperability stuff.arbiter
There must be some way of finding out the location of the drop, that's all I would require, just the path of the drop, then I could do the work myself and cancel the drag drop.Lloyd Powell
Power : have you found the way to find out the location of drop.Swapnil Gupta

1 Answers

2
votes

It appears there is no logically straight forward method to do such a thing.

But there is a work around (with a substantial amount of work for such basic functionaliy) that can be found at codeproject.

If anyone finds a tidy way of doing it, let me know, I'd be intrigued.