6

I have the code for Dropping a file into a WPF window:

XAML (in Home.xaml):

Drop="HomeWindow_Drop" AllowDrop="True">

C# (in Home.xaml.cs)

private void HomeWindow_Drop(object sender, DragEventArgs e)
{
    // Handle this
}

But when I try to drag a file into the Home Window, I get the windows "unavailable" cursor (the circle with a line though it), and the event doesn't get fired. I have no idea why it's doing this.

I never had this issue on Windows 7, and I'm now on Windows 8, but I don't think that would have anything to do with it?

Alexander Forbes-Reed
  • 2,823
  • 4
  • 27
  • 44

2 Answers2

0

Does the event goes off or is there nothing that is happening? If the event is going off i think that there is also another event that you must use to tell it is beginning and then change the cursor.

Quick look these are DragEnter, DragLeave and DragOver. Just change the Cursor on these events

Jordy van Eijk
  • 2,718
  • 2
  • 19
  • 37
0

For me, it was a VS Admin issue. For whatever reason, those events aren't triggered when the program is launched from within Visual Studio when running as Administrator, but they work fine when VS runs with normal privileges.

NielW
  • 3,626
  • 1
  • 30
  • 38