I am puzzled by this. I tried to drag and drop on a DataGridView . If you did not notice any events, I tried a simple form with a text box.
I would like to be able to drag and drop files or folders from Windows Explorer.
Something is missing for me because these events never fire. I read about DragEvents, Windows 7, and UIPI , but I still couldn't get around this.
I have no ideas, and I welcome your suggestions.
public Form1() { InitializeComponent(); this.AllowDrop = true; textBox1.AllowDrop = true; textBox1.DragEnter += new DragEventHandler(textBox1_DragEnter); textBox1.DragDrop += new DragEventHandler(textBox1_DragDrop); textBox1.DragOver += new DragEventHandler(textBox1_DragOver); } void textBox1_DragOver(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Move; } void textBox1_DragDrop(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Move; } void textBox1_DragEnter(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Move; }
It seems like this should work. I have a clean install on WP7 64 - with all the updates, I have no protection against viruses or malware, or anything (as far as I know) that can prevent these events from firing.
source share