Page 1 of 1

Cancel DMDropText

PostPosted: Mon Nov 17, 2014 6:50 pm
by w2m
If an exception occurs in a threaded procedure that is run from within the DMTextTarget1Drop event how do you cancel the drop so the cursor changes back to crDefault and the DMTextTarget1Drop event is cancelled. Also in general how to you cancel a drop?

Re: Cancel DMDropText

PostPosted: Mon Nov 17, 2014 9:22 pm
by DropMaster
Once you're in the OnDrop handler, the drop has effectively already happened so there's no concept of canceling. You can decide to catch the exception and do nothing, I suppose. But you can't let an exception escape and mess up the drag and drop loop.

Canceling is the province of the source side. To "cancel" on the target side, you can e.g. change the AcceptTextFormats property to stop accepting things when you don't want them. This can be done dynamically during the drag.

Hope this helps.