Реализовать чтение и сохранение параметров ComboBox при запуске и завершении программы.
В ComboBox есть парочка строчек, туда добавляем ещё несколько, как их сохранить в ini файл, у меня только одну строчку получается....
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | procedure TForm1 . ComboBox1KeyPress(Sender: TObject; var Key: Char );
begin
if Key =# 13 then
begin
ComboBox1 . Items . Add(ComboBox1 . Text);
ComboBox1 . Text := '' ;
end ;
end ;
procedure TForm1 . ComboBox1Click(Sender: TObject);
var
St : string ;
n, i, nst, ind : integer ;
begin
n := 0 ;
ind := 0 ;
nst := ComboBox1 . ItemIndex;
St := ComboBox1 . Items[nst];
for i := 1 to Length(St) do
begin
if St[i]<> ' ' then
ind := ind+ 1 ;
if (St[i]= ' ' ) or (i=Length(St)) then
begin
if ind= 5 then
n := n+ 1 ;
ind:= 0 ;
end ;
end ;
Label3 . Caption := IntToStr(n);
end ;
|