ComboEdit – how refresh items on Popup event?

  

I’ve got a problem with ComboEdit on Android. I need add item to ComboEdit.Items in OnPopup event, but my item is visible after second shows popup. How refresh Items in OnPopup event?

procedure TForm1.ComboEditPopup(Sender: TObject);
begin
ComboEdit1.Items.Add(‘MyItem’); // this item will by visible at next popup
end;

What I want achieve:
Items: ‘Aaa’, ‘Bla’, ‘Ble’, ‘Dee’.
User writes ‘Bl’. When he pushes Popup, ComboEdit will show him items: ‘Bla’, ‘Ble’
.

My currently code:

ComboEdit : TComboEdit;
Items : TStringList; // around 1000 strings

procedure TForm1.ComboEdit1Typing(Sender: TObject);
var
i : integer;
begin
ComboEdit.BeginUpdate;

ComboEdit.Items.Clear;
for i := 0 to Items.Count-1 do
if AnsiStartsText(ComboEdit.Text,Items[i]) then
ComboEdit.Items.Add(Items[i]);

Items.EndUpdate;
end;

Comments are closed.