Drag and Drop not working in C# Winforms Application
Is your DragDropEffect
set appropriately? Try placing this in the DragEnter Event Handler Method:
private void Form1_DragEnter(object sender, DragEventArgs e)
{
Console.WriteLine("DragEnter!");
e.Effect = DragDropEffects.Copy;
}
By default it was set to DragDropEffects.None
so the Drop event wouldn't fire.
For those who would read this because tips above do not work.
Notice that Drag&Drop won't work if you run Visual Studio or your app "As Administrator" as reported here: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2164233-fix-drag-and-drop-to-open-file-when-running-as-adm
Don't forget in properties of the form to change AllowDrop to "True" Your code is probably fine but if this property is not enabled to true it won't work. It is set to false by default.