I am trying to fetch the currently selected index of a combo box from another subroutine, not the SelectedIndexChanged event. It seems that it only works once after the event has been triggered. From then on the result is always 0, regardless of which item is actually selected in the combo box. Is it possible to get the currently selected index of a combo box programmatically?
Log window:
index 1
selectedIndexChanged 1
Log window:
selectedindex 1 (first time subroutine is run after SelectedIndexChanged event)
selectedindex 0 (returns 0 until the item is changed)
B4X:
Private Sub cmbHuman_SelectedIndexChanged (Index As Int)
Log("index " & Index)
Log("selectedIndexChanged " & cmbHuman.SelectedIndex)
End Sub
index 1
selectedIndexChanged 1
B4X:
Sub getindexes()
Log("selectedindex " & cmbHuman.SelectedIndex)
End Sub
selectedindex 1 (first time subroutine is run after SelectedIndexChanged event)
selectedindex 0 (returns 0 until the item is changed)