Unfortunately, that doesn't work. I fill the combo box and then delete, for example, item 3 (with index 2). The combo box is repopulated. If I then select the third item again (with index 2), the sub isn't executed because the index is 2 again and therefore hasn't changed. I'd like to fix that problem.
I clear the cmbobox with cmbbox.clear but there should also be a cmbbox.clearindex.
If the user clicks "Item 1" again while "Item 1" is already selected, the native control doesn't generate a new event.
There's no standard, clean, and portable way in B4X to "intercept" this additional click with B4XComboBox.
If you really need a reaction on every open/selection, even if the item remains the same, the solution would be to create a custom ComboBox using xCustomListView.
@mangojack probably meant: B4XComboBox1.SelectedIndex = -1
Can you put a log statement in the B4XComboBox1_SelectedIndexChanged (Index As Int) subroutine that shows the value of Index?
Did you remove the item in the B4XComboBox AND in the list that was used to populate the B4XComboBox?
Paul, I tried 2 ways: cmbLijst.cmbBox.RemoveAt(xx) and completely clear and the fill the combobox again. And like Zed said there is no intercept when I delete the second item (index 3) and after refilling the combobox and click again the new box at item 2 (index 3).
I found a solution: I use cmbLijst_SelectedIndexChanged(-1) and in the sub cmbLijst_SelectedIndexChanged get away as fast as I can: If Index = -1 Then Return This works!