How to determine if a drag and drop operation has completed in FireMonkey?

I want to find out if the draggable control is released outside of any target.

You might think that OnDragEnd should be used, but this event does not work (they forgot to call the DragEnd procedure in the FMX.Types module).

As an alternative, I tried OnMouseUp for the draggable control. Does not work. Does not start when DragMode = dmAutomatic.

As a last resort, I tried to redefine the MouseUp procedure of the form itself (since all mouse events go through the form before being passed to the corresponding control). Surprise: The MouseUp procedure is not called when the DragMode = dmAutomatic control.

Surprisingly, this is very simple, which is very difficult to achieve, but I hope someone would find a working solution.

+7
source share
1 answer

You can override the DragLeave method of the form. This method is called for all objects that fall outside the target area.

+1
source

All Articles