How can I make a SearchBox visible when I open the list of a ComboBox in Delphi

  

I am using Delphi 10 Seattle to create multi device software (Win32) (Firemonkey).
How can I show a SearchBox only when the list is shown in a ComboBox.
I fill the ComboBox in code with ListBoxItems. See for an example below.
Now the SearchBox is displayed over a closed ComboBox.

procedure AddItems;
var
SearchBox: TSearchBox;
Item: TListBoxItem;
begin
ComboBox.Items.Clear;
SearchBox := TSearchBox.Create(ComboBox);
SearchBox.Align := TAlignLayout.Contents;
SearchBox.Parent := ComboBox;
SearchBox.Visible:=True;
Item := TListBoxItem.Create(ComboBox);
Item.Parent := ComboBox;
Item.Text := ‘Item 1’;
Item := TListBoxItem.Create(ComboBox);
Item.Parent := ComboBox;
Item.Text := ‘Item 2’;
end;

Comments are closed.