WebPopupMenu.SelectedRowIndex

From Xojo Documentation

Property (As Integer )
aWebPopupMenu.SelectedRowIndex = newIntegerValue
or
IntegerValue = aWebPopupMenu.SelectedRowIndex

New in 2020r1

Supported for all project types and targets.

The number of the selected row.

Notes

If no item is selected, SelectedRowIndex returns -1.

If the SelectedRowIndex is set to a value less than -1 or greater than the last index, an OutOfBoundsException will occur.

To clear the selected item, set SelectedRowIndex = -1.

Sample Code

The following code in the SelectionChanged event handler displays the text from the selected row:

If Me.SelectedRowIndex >= 0 Then
MessageBox(Me.RowAt(Me.SelectedRowIndex))
End If

The following code displays a message if no row is selected:

If TypePopup.SelectedRowIndex = -1 Then
MessageBox("Please select a row first.")
End If