views:

92

answers:

3

I'm looking to provide users with ability to drag&drop files from grids and other controls in my application into Explorer. Any good samples/articles for that?

+1  A: 

Here is a sample application but it cannot handle large files: Transferring Virtual Files to Windows Explorer in C#

Giorgi
+1  A: 

Here is some information from the microsoft forums http://social.msdn.microsoft.com/forums/en-US/winforms/thread/f57ffd5d-0fe3-4f64-bfd6-428f58998603/.

I did find a bunch of relevant articles searching with the title of this post

btlog
Looks familiar. But wrong way around.
Hans Passant
+3  A: 

It's pretty straight-forward, just call DoDragDrop in a MouseDown event. You'll need actual files on disk for this to work.

private void Form1_MouseDown(object sender, MouseEventArgs e) { 
   string[] files = new string[] { @"c:\temp\test.txt" };
   this.DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy); 
}
Hans Passant