ui.DragDrop.SetOperation()

The dragged objects can be copied or moved to the new destination. The SetOperation() method is used in the ON DRAG_START clause to specify the default Drag and Drop action.

 

The SetOperation() method does not return anything and can pass one of the three arguments given in the table below:

 

Parameter

Description

Copy

Makes Drag and Drop actions copy the source object

Move

Makes Drag and Drop actions move the source object

NULL

Makes the program cancel/deny the Drag and Drop process

 

You can call the SetOperation() method within any of the Drag and Drop triggers. It is commonly used in ON DRAG_START block to specify the result of the Drag and Drop action, as well as in ON DRAG_ENTER and ON DRAG_OVER blocks to cancel Drag and Drop events, when the dragged object format does not correspond to the format of the target place. When the method is used in ON DRAG_ENTER block, it forces a defined Drag and Drop operation to be performed.