Fires when the user drops tree items onto the control.

Parameters

ParameterDescription
SourceCtrlThe tree from where the items are being dragged
ItemsThe items being dragged
DestItemThe drop target item
ActionIndicates how the items are to be dropped
ShiftIndicates whether or not the SHIFT key is down
CtrlIndicates whether or not the CTRL key is down

Remarks

The OnDrop event fires when the user drops items onto control. The SourceCtrl contains the CtrlEntId of the tree from where the items are being dragged. The Items parameter is a comma delimited list of the items themselves.

The DestItem is the key of the item that the user chose as a drop target. The Action parameter indicates how, in relation to the drop target, the items are to be dropped. It will be one of three values: "Add", "Before", and "After". If the Action is set to "Add", then you will want to add the items as children to the drop target. If it is set to "Before" or "After", then insert the items before or after the drop target accordingly. The value of the Action property depends on the DropBehavior property, and the user will have seen feedback based on that value.

The Shift and Ctrl parameters indicate the current state of the SHIFT and CTRL keys respectively. They will be set to 1 if their respective keys are pressed.

You can use this event when you need to perform specific operations on a drop. However, keep in mind that the AutoDrop property is available to do this work for you in some cases.

See the Drag and Drop topic for more details.

Example

Transfer Param1 to SourceCtrl 
Transfer Param2 to Items 
Transfer Param3 to DestItem 
Transfer Param4 to Action 
Transfer Param5 to Shift 
Transfer Param6 to Ctrl 

// Perform a move 
Convert ',' to @VM in Items 
Send_Message(SourceCtrl, "OLE.SendItems":@FM:1, Items:@FM:CtrlEntId:@FM:DestItem:@FM:Action:@FM:0:@FM:1) 
Convert @VM to @FM in Items 
Send_Message(SourceCtrl, "OLE.RemoveItems", Items)

See Also

OnDragStartOnDragEnterOnDragExit

  • No labels