PopupMenu.ListIndex

From Xojo Documentation

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

Supported for all project types and targets.

Used to get or set the selected item number. The first item is numbered zero.

Notes

A value of -1 means no selection. ListIndex may be set using the Properties pane to set the default value of PopupMenu control. If you use the InitialValue property to populate the PopupMenu control and set a value of ListIndex that corresponds to a default item, that item will be displayed in the IDE.

Example

The following example changes the selected item to the third item:

FruitMenu.ListIndex = 2