ListBox.LastRowIndex

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aListBox.LastRowIndex

New in 2019r2

Supported for all project types and targets.

The number of the last row of the ListBox. Because the ListBox is zero-based, this value will be 1 less than the ListBox.RowCount.