ListBox.DragOverRow

From Xojo Documentation

Event


ListBox.DragOverRow(x As Integer, y As Integer, obj As DragItem, action As Integer, ByRef row As Integer, ByRef parentRow As Integer, ByRef location As DropLocations) As Boolean

New in 2017r2

Supported for all project types and targets.

Invoked during dragging, similar to the DragOver event.

Enumerations

The following enums are used by the DragOverRow and DropObjectOnRow events:

Class Constant Description
OnRow The drop is occurring on the row itself.
AfterRow The drop is occurring between rows, after the row specified. The row can be in the range of [-1, RowCount-1] and specifying -1 will insert it at the top of all the rows. This value will also be RowCount-1 if the user drags below the item list.
AfterAllRows The drop is occurring after all rows in the list.
OnControl The drop is occurring on the entire control, not on a particular row. This matches the previous behavior.

Notes

Event handlers can 'retarget' a drop by altering the row, parentRow, or location parameters.

  • x: The x coordinate of the drop, relative to the left of the ListBox.
  • y: The y coordinate of the drop, relative to the top of the ListBox.
  • obj: The data actually being dropped.
  • action: The drag action, which can be things like move or copy. Constants already exist in the DragItem class for this.
  • row: The proposed target row for the drop.
  • parentRow: When the listbox is non-hierarchical, this will always be -1. When the Listbox is hierarchical, this is the row that the item is being dragged into. If the item is being dragged to the top level, parentRow will have a value of -1.
  • location: Whether the drop is going between two rows, on the row itself or just on the control. Uses the ListBox.DropLocations enum.

Returning True prevents the drop from occurring and the DragOver event from firing. Otherwise the DragOver event fires.