ListBoxPlayers という TListBox があり、ListBoxPlayers.Items は TListBox 内の TStrings のリストを参照していると思います。この機能を使用しようとしていますが、機能していないようです。何か案は?
編集:だから、表示する文字列の数に応じて TListBox のサイズを設定しようとしています。これが私のコードです:
procedure TForm3.edtSearchChange(Sender: TObject);
begin
ListBoxPlayers.Clear;
if Length(edtSearch.text) > 0 then
begin
setSizeListBox((ListBoxPlayers.Items.Count));
ListBoxPlayers.Visible:=true;
dynamicSearch(edtSearch.Text)
end
else
ListBoxPlayers.Visible:=false;
end;
ListBoxPlayers.Items.Count
リストには多くの項目がありますが、常に 0 のままです。