WebPopupMenu.ListIndex

From Xojo Documentation

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

New in 2010r4

Supported for all project types and targets.

Used to get or set the selected item number. The first item is numbered zero. The default is -1, which means no selection.


Notes

A value of -1 means no selection. ListIndex can be set using the Properties in the IDE to set the default row that will be selected.

Any change to ListIndex also results in the SelectionChanged event handler being called.


Example

Getting the selected item in the SelectionChanged event and displaying it in a WebLabel control.

Label1.Text = "You selected: " + Me.List(Me.ListIndex)


Changing the selection via code, which causes the SelectionChanged event handler to get called:

PopupMenu1.ListIndex = 1 // Select 2nd row


Removing the selection:

PopupMenu1.ListIndex = -1