Drop

[event icon] Drop() Event

Drag drop event

Applies to: Button , CheckBox , Graph , Grid , KCMLEdit , List Box , Picture Button , Radio , Rich Edit , Tree

Introduced in KCML version 6.60


>

Drop

This event is called as a result of the user dragging onto this control. To enable the event the control must have its DragStyle property set to DragTarget or DragBoth.

When the event is called the drag source control is stored as an object in the DragSourceControl property. If the source control has draggable components, for example a grid cell the component is stored in the DragSourceItem property. In the case of a simple control DragSourceItem will be a NULL object. If the target of the drag has components the DragTargetItem property identifies where the drag landed. The type of the source control can be determined by inspecting its Class$ property. For completeness a DragTargetControl property exists. This will not normally be required as the target control is identified by the event.

The following table shows which controls have draggable components.

Control Drag Component
Grid Cell
Tree Node
List Item
DEFEVENT Form1.TreeControl1.Drop()
        // REM A tree so we need to know which node was dragged to
        OBJECT TargetItem = ..DragTargetItem
        OBJECT SourceControl = ..DragSourceControl
        OBJECT SourceItem = ..DragSourceItem
        REM We will simply set the node's text the that of the drag source
        IF (OBJECT SourceItem <> NULL)
                TargetItem.Text$ = SourceItem.Text$
        ELSE
                TargetItem.Text$ = SourceControl.Text$
        END IF
END EVENT

See also

Button methods, properties and events. CheckBox methods, properties and events. Graph methods, properties and events. Grid methods, properties and events. KCMLEdit methods, properties and events. List Box methods, properties and events. Picture Button methods, properties and events. Radio methods, properties and events. Rich Edit methods, properties and events. Tree methods, properties and events.