DragDrop certain file types only
-
Is it possible to restrict a DragDrop to certain file types only? In my case, I'm using zip files, and I can prevent it from dropping in the DragDrop handler. However, it seems that a better place to catch it might be in DragEnter?
-
Is it possible to restrict a DragDrop to certain file types only? In my case, I'm using zip files, and I can prevent it from dropping in the DragDrop handler. However, it seems that a better place to catch it might be in DragEnter?
Oddly, you can prevent the dragDrop in the DragEnter handler by just changing the visual effect:
e.Effect = DragDropEffects.None
You'd think this would just change the cursor, but it does actually prevent the _DragDrop from firing. This has the advantage of showing the 'not allowed' cursor if they drag a file type you don't want to accept.