Link Search Menu Expand Document

DragSource.DoDragDrop Method

Explanation Start drag & drop.

When this method is executed, it waits for the mouse to move for a certain period of time, and if it does not move, the method ends as it is. Also, if the transfer data is not set in advance, it will end as it is.

When this method is completed, all the data set by the SetString method etc. up to that point will be cleared.
Call format source.DoDragDrop( [ type [, waitTime [, margin ] ] ] )
Return value None
Arguments integer type Drag and drop type. Specify the following values. If omitted, it will be $COPYMODE.
Constant Value Description
$COPYMODE 256 Copy mode
$MOVEMODE 512 Move mode
How to distinguish between copy mode and move mode processing depends on the implementation of the drop destination.
It is now possible to specify $COPYMODE and $MOVEMODE at the same time since Ver.5.0.0
integer waitTime The waiting time for the drag operation after the method is executed. Able to specify 0 to 1000 (1 second) in millisecond units. If omitted, the setting value of the OS is used.
integer margin The movement width of the mouse to move to the drag motion. Able to specify 0 to 16 in pixel units. If omitted, the setting value of the OS is used.
Exception Func-4 Invalid argument value
Example of use
    source.SetString("Drag and Drop");
    source.DoDragDrop($MOVEMODE, 10, 8);
    
Related item