【发布时间】:2015-11-17 10:29:49
【问题描述】:
我正在使用 Delphi 10 Seattle 创建多设备软件 (Win32) (Firemonkey)。 仅当列表显示在 ComboBox 中时,如何显示 SearchBox。 我用 ListBoxItems 在代码中填充 ComboBox。请参阅下面的示例。 现在 SearchBox 显示在关闭的 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;
【问题讨论】:
标签: delphi combobox firemonkey search-box