How to use the dragdrop technique

Possible duplicate:
Drag to the desktop / explorer

I have a list containing the file path (Ex: D: \ myfile.txt). I want my user to be able to copy the selected item by dragging the item in the list and dropping it onto my path of the desired user in the window explorer

+4
source share
1 answer

I'm not sure about doing this from WPF, but from the windows used to work more or less:

private void listView1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) { string[] files = GetSelection(); if(files != null) { DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy | DragDropEffects.Move); } } 

it is important to specify DataFormats.FileDrop and run DoDragDrop ... with some changes, I think you should make it work from WPF

+1
source

All Articles