Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

How to narrow down a dropdown list of a ComboBox with a TSearchBox

$
0
0

How to narrow down a dropdown list in a ComboBox with a TSearchBox in a firemonkey application (Delphi 10 Seattle). If I click in the TSearchBox to enter some text the list is closed.

 

type

  TComboBoxTestForm = class(TForm)

    procedure FormCreate(Sender: TObject);

  private

    FSearchBox: TSearchBox;

  end;

 

procedure THeaderFooterForm.FormCreate(Sender: TObject);

begin

  FSearchBox := TSearchBox.Create(nil);

  FSearchBox.Align := TAlignLayout.Contents;

  FSearchBox.Parent := ComboBox;

  FSearchBox.Visible:=False;

end;

 

procedure TComboBoxTestForm .ComboBoxClosePopup(Sender: TObject);

begin

  FSearchBox.Visible:=False;

end;

 

procedure TComboBoxTestForm .ComboBoxPopup(Sender: TObject);

begin

  FSearchBox.Visible:=True;

end;


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>