Is this true for VCL only?
In FMX, much more is handled differently.
If so, how can I achieve the same behavior as VCL in FireMonkey?
A simple workaround is to not have the OnChange event OnChange before changing the ItemIndex event and then restoring it.
A simple procedure for this would be like this (as @Remy pointed out):
procedure SetItemIndex(ix : Integer; cb: TComboBox); var original : TNotifyEvent; begin original := cb.OnChange; cb.OnChange := nil; try cb.ItemIndex := ix; finally cb.OnChange := original; end; end;
source share