Enables automatic dropping of tree items.

Usage

Set_Property(OLECtrlEntID, "OLE.AutoDrop", Boolean)

Values

[True | False]

Default: False

Remarks

The AutoDrop property can be used to enable or disable automatic dropping of items from one tree to another. By default, this feature is disabled. When enabled, the control will automatically copy the dragged items as determined by the current value of the DropBehavior property. If you want to implement custom drag and drop behavior, leave this property disabled and handle the OnDrop event.

DropBehavior = "Control"

When the DropBehavior property is set to "Control," then the automatic behavior is to copy the dragged tree items along with their parents in an attempt to maintain a duplicate of the source tree. This is equivalent to calling the TransferItems method during the OnDrop event.

DropBehavior = "Add"

When the DropBehavior property is set to "Add," then the automatic behavior is to copy the tree items as children of the target item. The dragged tree items will be added to the bottom of the target drop item if children already exist unless the target drop item is sorted. In that case, the items are added in sorted order. This is equivalent to calling the AddItems method during the OnDrop event.

DropBehavior = "Insert"

When the DropBehavior property is set to "Insert," then the automatic behavior is to copy the tree items between two target drop items. This is equivalent to calling the InsertItems method during the OnDrop event.

There are several properties, methods, and events necessary to implement a complete drag and drop solution. See Drag and Drop for more details.

Example

// Disable auto drop 
Set_Property(@Window:".OLE_TREE", "OLE.AutoDrop", 0) 

// Enable auto drop 
Set_Property(@Window:".OLE_TREE", "OLE.AutoDrop", 1)

See Also

DropBehaviorOnDropAddItemsInsertItemsTransferItems

  • No labels