ListBox.DropObjectOnRow
From Xojo Documentation
Event
ListBox.DropObjectOnRow(x As Integer, y As Integer, obj As DragItem, action As Integer, row As Integer, parentRow As Integer, location As DropLocations)
New in 2017r2
Supported for all project types and targets.
New in 2017r2
Supported for all project types and targets.
Invoked when a drop has finished.
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
The row, parentRow, and location are the values previously set by the DragOverRow event handler.
The DropObject event fires after this event.
Examples
This code in the event handler shows the different values that can be passed for the Location parameter.
Select Case location
Case listbox.DropLocations.AfterAllRows
MessageBox "add row after all rows"
Case listbox.DropLocations.AfterRow
MessageBox "add row after rowindex = " + CStr(row)
Case listbox.DropLocations.OnControl
MessageBox "drop occurred ON control"
Case listbox.DropLocations.OnRow
MessageBox "add row to rowindex = " + CStr(row)
End Select
Case listbox.DropLocations.AfterAllRows
MessageBox "add row after all rows"
Case listbox.DropLocations.AfterRow
MessageBox "add row after rowindex = " + CStr(row)
Case listbox.DropLocations.OnControl
MessageBox "drop occurred ON control"
Case listbox.DropLocations.OnRow
MessageBox "add row to rowindex = " + CStr(row)
End Select