C # ...">

Drop file into WPF window

I have code to delete a file in a WPF window:

XAML (at 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 the file into the Home Window, I get the โ€œinaccessibleโ€ cursor window (a circle with a line, although it is), and the event does not fire. I have no idea why this is being done.

I have never had this problem in Windows 7, and now I am in Windows 8, but I donโ€™t think that would have anything to do with it?

+4
source share
1 answer

Is an event happening or is there nothing that is happening? If the event ends, I think there is another event that you should use to report that it starts, and then change the cursor.

Rather, look at DragEnter, DragLeave, and DragOver . Just change the cursor on these events.

0
source

Source: https://habr.com/ru/post/1438580/


All Articles