dragListIndex

dragListIndex(): Integer;

The dragListIndex method of the ListBox class provides the listIndex property of a list box entry that corresponds to the x (horizontal) and y (vertical) positions received from dragOver events during the drag operation. Similarly, when the dragged window is dropped, the window that it is dropped onto receives a dragDrop event.

The dragOver and dragDrop events specify the x and y location of the drag operation.

The dragListIndex method value is -1 if there is no list box entry at that position.

The code fragment in the following example shows the use of the dragListIndex method.

targetIndex.caption := listBox1.dragListIndex.String;