Listbox.ItemIndex stays ‘-1’ after ListBoxItem selection (FM)


When clicking at the listbox TListBox items TListBoxItem, the program control gets into the OnClick event handler of the listbox item (thats ok), yet the itemindex property of the listbox staying -1 while in the event handler (debug), so its like no items getting selected. Why this behaviour?

The listbox items and the event handler for the items are added programatically.

Platform is android.

Edit >>

As i see, the itemindex property getting the right value after the program control step out from the event handler, because at the next item selection i get the previously selected itemindex in the OnClick event handler. Why?

Comments are closed.