Drag Drop from .NET application to Explorer

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); 
}

Leave a Comment