PopupMenu.LastRowIndex

From Xojo Documentation

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

New in 2019r2

Supported for all project types and targets.

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