How to Ignore a DragItem

Hi …

I have an array of canvas objects and any can be dragged and dropped onto any other one. The key word be other.

Before the mouse has left the source canvas it thinks it has a new DragItem, the one it just created upon MouseDown.

I was thinking AcceptTextDrop etc. could be set to False till the mouse was well on its way and out of the way, but that appears a non-option.

Any thoughts on how is this is typically handled … ?

If there is some built in way to do this, I don’t know about it but I would certainly like to know. My suggestion would be to add a token phrase at the start of the text. For example when you are creating the dragitem from a canvas called “Canvas1” you could make the text property “Canvas1: whateverinfogoeshere”. Then in the DropObject event you could test like this:

  if left(obj.Text, 9) = "Canvas1: " then
    'bad data, ignore it
  else
    'dropped from some other canvas, use the data
    dim passedText as string = mid(obj.Text, 10)
    'use the passedText in the Canvas
  end if

Additionally, a feature request for a “source object” could be in order, or you could subclass DragItem and add a source object property yourself that you can test in the DropObject event to eliminate bad data.