New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
End preview and/or DrapDrop operation in DrapDrop handler #14
Comments
One possible workaround for this problem is to wrap this into a delegate like so:
This works but seems to be a bit odd to me. I also played around with you library. It seems to me that there should be some way where the DragDrop operation can be cancelled from within the DragDrop handler. Therefore I tried to play around with |
Oh my god, I am sorry I must have overseen this. Yeah, that's an issue. The handler for the drop event fires before any code of mine can interact. That's why the overlay form is not hidden in that case. This happens for every form that is blocking the UI, like modal forms or Message Boxes. I don't see a problem with your workaround as However there is a nicer approach in my opinion, but it requires to know the receiver control(s) when you initialize the Drag&Drop operation: You can skip the pic.InitializeDragAndDrop()
.Copy()
.Immediately()
.WithData(pic.Image)
.WithPreview(Grayscale((Bitmap)pic.Image)).LikeWindowsExplorer()
.To(PreviewBoxes, (target, data) =>
{
target.Image = data;
MessageBox.Show("Done");
}); Hope this helps. |
Just opened issue #17 that makes this use case clearer and doesn't need |
My use case:
Problem:
If a new form is created directly in the event handler the preview still persists.
Is there any chance to end the DragDrop operation in the DragDrop handler?
Below my simplified DragDrop handler which illustrates the problem. The form may be any empty form.
The text was updated successfully, but these errors were encountered: