Please see this sample project.
Drag e.g. row 2 to the place of row 1 (drag line between “folder” and “row 1” appears).
The row parameter in the DropObjectOnRow event is 0.
Am I understanding anything wrong here or is this a bug?
In my opinion the row parameter should be 1.
You could alter your code to the following to see the different locations that can be passed in:
Select Case location
Case listbox.DropLocations.AfterAllRows
MsgBox "add row after all rows"
Case listbox.DropLocations.AfterRow
MsgBox "add row after rowindex = " + CStr(row)
Case listbox.DropLocations.OnControl
MsgBox "drop occurred ON control"
Case listbox.DropLocations.OnRow
MsgBox "add row to rowindex = " + CStr(row)
End Select
Works on standard Row and in the original project, if you drop a Row before Row 0, the returned value is -1.
(from inside a hierarchical Row or not: I inserted 3 Rows before the original folder row).