Author: Tomas Rutkauskas
How to save items of a TComboBox to an ini file
Answer:
This is one possibility. It will put the items in a seperate section:
1 procedure TForm1.WriteComboToIni;
2 var3 IniFile: TIniFile;
4 Cnt: integer;
5 begin6 IniFile := TIniFile.Create('c:\test.ini');
7 try8 with ComboBox1 do9 if Items.Count > 0 then10 for Cnt := 0 to Items.Count - 1 do11 IniFile.WriteString('Section', 'Items' + IntToSTr(Cnt), Items[Cnt]);
12 finally13 IniFile.Free;
14 end;
15 end;