本文整理自网络,侵删。
描述当您下拉列表时,此示例用一组打开的表单填充组合框的列表。每次下拉列表时都会重新生成列表,因此,如果应用程序打开或关闭表单,则组合框保持最新状态。
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;
相关阅读 >>
Delphi idtcpclient和idtcpserver主要属性
更多相关阅读请进入《Delphi》频道 >>