Delphi-Quellcode:
procedure TForm1.ComboBox1Change(Sender: TObject);
var strings:TStrings;
path:String;
i:Integer;
begin
strings := TStringList.Create;
try
path := ExtractFilePath(ParamStr(0));
path := path + 'Testdatei.txt';
strings.LoadFromFile(path);
if strings.Count > 0 then
begin
for i := 0 to strings.Count - 1 do
begin
If ComboBox1.text=strings[i] then
Memo1.Lines.add(strings[i]);
end;
end;
finally
strings.Free;
end;
end;
So sollte es funktionieren.
Grüße
Klaus