You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Cancels a potential drag operation.

Usage

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

Values

[True | False]

Default: False

Remarks

The Cancel property is automatically set to 0 before the OnDragStart event is fired. If the drag operation is not desired, then setting this property to 1 during the OnDragStart event will prevent the drag from occurring.

It is much easier to set drag and drop behavior using the DragConditionDropConditionItemDraggable, or ItemDroppable properties. The OnDragStart event is useful only when the drag and drop rules are more complex.

Example

OLE_TREE.OnDragStart: 

   // Get the list of items to be dragged 
   Items = Param1 
   Convert ',' to @FM in Items 
    
   // Don't allow users to drag if any of the items are of the "Group" class 
   Cancel = 0 
   Pos = 1 
   Flag = "" 
   Loop 
       Remove Item From Items At Pos Setting Flag 
   While Item NE "" AND Cancel EQ 0 
       Class = Get_Property(CtrlEntId, "OLE.ItemClass[":Item:"]") 
       Cancel = Class _EQC "Group" 
   Repeat 
    
   // Cancel if need be 
   Set_Property(CtrlEntId, "OLE.Cancel", Cancel) 
    
return

See Also

DragConditionDropConditionItemDraggableItemDroppableOnDragStart

  • No labels