Notifications
Clear all
Language and dialect
2
Posts
2
Users
0
Reactions
459
Views
Topic starter
Does somebody know how to get the index of the Selected Item inside a Box? This is probably quite simple, but I miss the ItemIndex from a regular TCombobox.
Christian
Posted : 05/04/2023 8:36 pm
You are correct, I did not expose the SelectedIndex, which was a mistake on my part. I have added this to my list, so it will be there in the next update!
In the meantime, use this:
var cbIndex := TVariant.asInteger( FComboBox.Handle.selectedIndex );
If you set that attribute to -1, it means "unselected", so if you want to force the user to pick one, just do:
FComboxBox.Handle.selectedIndex := -1;
Sorry that i somehow missed this!
Posted : 07/04/2023 11:26 am