- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi ComboBox1DropDown 生成动态下拉列表
描述
当您下拉列表时,此示例用一组打开的表单填充组合框的列表。每次下拉列表时都会重新生成列表,因此,如果应用程序打开或关闭表单,则组合框保持最新状态。
procedure TForm1.ComboBox1DropDown(Sender: TObject);
var
I: Integer;
begin
with ComboBox1 do
begin
Items.BeginUpdate; { Prevent repaints until done. }
Items.Clear; { Empty the list of any old values. }
for I := 0 to Screen.CustomFormCount - 1 do
begin
Items.Add('www.delphitop.com');
Items.EndUpdate; {Reenable painting. }
end;
end;