How to check if Drag was canceled

Hi,
I drag my Nodes from a ListBox (I send you an example earlier). All works well, but I can’t check if someone presses the Escapekey during the drag operation. I tried to override DraggingTool.OnQueryContinueDrag, but this wasn’t called.

So how can I do something If the User presses the Escapekey to cancel the Drag’n’Drop?

You mean DraggingTool.DoQueryContinueDrag?

Yes, I set a Breakpoint but - no break.

You could override DraggingTool.DoDragLeave to clean up whenever the mouse leaves the diagram, including when it is canceled.

Ok, I’ll try this.
Thank you.

This is working!

    public override void DoDragLeave(DragEventArgs e)
    {
        if (e.Effects == DragDropEffects.None)
        {
            DoCleanup();
        }
        base.DoDragLeave(e);
    }