Problem with FileDrop
-
How to implement Drag&Drop capability of a WinForms application, when we want user to be able to drag and drop files and directories outside the main form through FileDrop? Dragging files from e.g. Windows Explorer to WinForms app is not a problem. But the reverse way is a big problem for me.
-
How to implement Drag&Drop capability of a WinForms application, when we want user to be able to drag and drop files and directories outside the main form through FileDrop? Dragging files from e.g. Windows Explorer to WinForms app is not a problem. But the reverse way is a big problem for me.
You need to do something like this:
string[] aFiles = ** filenames of that you want to drag out **;
DoDragDrop(new DataObject(DataFormats.FileDrop, aFiles), DragDropEffects.Copy | DragDropEffects.Move);
If the files you want to drag out aren't actually real files, the easiest solution is probably to create temporary files, and provide those filenames.
-- Help me! I'm turning into a grapefruit! Buzzwords!