Zwei Routines zum Laden und Speichern. Ungetestet, sollte aber funktionieren.
Delphi-Quellcode:
procedure LoadListView(LV: TListView; aFile: string);
var
I: Integer;
Item: TListItem;
begin
with TStringList.Create do
try
LoadFromFile(aFile);
I := 0;
while I < Count do
begin
Item := LV.Items.Add:
Item.Caption := Strings[I];
Inc(I);
if I = Count then
Break;
Item.SubItems.CommaText := Strings[I];
Inc(I);
end;
finally
Free;
end;
end;
procedure SaveListView(LV: TListView; aFile: string);
var
I: Integer;
begin
with TStringList.Create do
try
for I := 0 to Pred(LV.Items.Count) do
begin
Add(LV.Items[I].Caption);
Add(LV.Items[I].SubItems.CommaText);
end;
SaveToFile(aFile);
finally
Free;
end;
end;