Einzelnen Beitrag anzeigen

Flippo

Registriert seit: 26. Sep 2004
111 Beiträge
 
Delphi 2005 Personal
 
#1

Fiese Stringlist löscht meine Werte

  Alt 22. Dez 2005, 20:16
Hallo,
ich hab ein vermutlich einfaches Problem, ich komm aber einfach nicht drauf.
Hab einen in meinen Augen identischen(auf die List bezogen) code geschrieben, der funktioniert hat warum verlier ich meine Werte da?
Delphi-Quellcode:
type
  TForm1 = class(TForm)
  procedure FormCreate(Sender: TObject);
  private
  public
  List:TStrings;
  Tastatur:array[1..35] of TPanel;
  procedure OnTasteClick(Sender:TObject);
  procedure TastaturErstellen;
  end;
.
.
.
procedure TForm1.FormCreate(Sender: TObject);
var SR:TSearchRec;
begin
if findfirst(extractfilepath(paramstr(0))+'Conf.ini',faAnyFile,SR)<>0 then Einrichten;
List:=TStringlist.Create;
List.LoadFromFile(extractfilepath(Paramstr(0))+'Conf.ini');
showmessage(List[1]); <<<< Hier sind meine Werte noch da
TastaturErstellen; <<< hier nichtmehr
showmessage(List[1]); <<<< und hier sind sie auch nicht wieder aufgetaucht ;-)
end;
.
.
.
procedure TForm1.TastaturErstellen;
var i,r,s:integer;
begin
   for i:= 0 to 35 do
   begin
      case i of
      0..9: begin r:=5; s:=((i+1)*22)- 15 end;
      10..19:begin r:=30; s:=(((i+1)-10)*22)- 10 end;
      20..28:begin r:=55; s:=(((i+1)-20)*22)- 5 end;
      29..35:begin r:=80; s:=(((i+1)-29)*22)end;
      end;
   Tastatur[i]:=TPanel.create(form1);
   Tastatur[i].parent:=form1;
   Tastatur[i].top:=r;
   Tastatur[i].left:=s;
   Tastatur[i].height:=20;
   Tastatur[i].width:=20;
   if List.strings[i]='Leerthen Tastatur[i].font.color:=clblack
   else Tastatur[i].font.color:=cllime;
   Tastatur[i].caption:=chr(w(i));
   Tastatur[i].OnClick:=OnTasteClick;
   end;
end;
  Mit Zitat antworten Zitat