unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ComboBox1: TComboBox; Button1: TButton; Memo1: TMemo; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Memo1KeyPress(Sender: TObject; var Key: Char); private { Private declarations } StrList: TStringList; procedure OnStrChange(Sender: TObject); public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);begin //StrList.Clear; StrList.LoadFromFile('Test.txt');end;procedure TForm1.FormCreate(Sender: TObject);begin StrList:=TStringList.Create; StrList.OnChange:=OnStrChange;end;procedure TForm1.FormDestroy(Sender: TObject);begin if Assigned(StrList) then StrList.Free;end;procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);begin if Key=#13 then begin StrList.Assign(Memo1.Lines); end;;end;procedure TForm1.OnStrChange(Sender: TObject);begin ComboBox1.Items.Assign(StrList); ComboBox1.ItemIndex:=0;end;end.