I am trying to create a window form to which I can delete a file / folder.
I have the following code in a WinForms application
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_DragEnter(object sender, DragEventArgs e) { Debug.Print("DragEnter"); } private void Form1_DragDrop(object sender, DragEventArgs e) { MessageBox.Show("Dropped!"); } }
I set the AllowDrop property to true. I tried to run the application in debugging in Visual Studio. Based on answers to other similar questions, I tried to run the compiled exe as administrator. I tried to run the compiled exe not as an administrator.
But no matter what I do, I cannot fire the DragDrop event. However, the DragEnter event fires. What am I missing?
source share