Ich habe hier den Code :
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: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69:
| procedure TForm11.FormCreate(Sender: TObject); var i,a : integer; begin i := 1; a := 0; Image1.Picture.LoadfromFile ('F:\Kasse\ProgrammDaten\Panel1.bmp'); T := TTable.Create(form11); T.DatabaseName := 'C:\Nguyen\Info Post Programm\'; T.TableName := 'Material1.dbf'; T.Active := True; D := TDataSource.Create(form11); D.DataSet := T; while not T.eof do begin if (T['Artnr']>=100)and(T['Artnr']<=139) then begin L1[1] := TLabel.create(Form11); L1[1].parent := Form11; L1[1].Caption :=T['Artnr']; L1[1].Font.Name := 'Lucida Console'; L1[1].Font.Size := 9; L1[1].Font.Style := [fsBold]; L1[1].Top := i*20; L1[1].Left :=55+a; L1[1].Transparent := True;
L2[1] := TLabel.create(Form11); L2[1].parent := Form11; L2[1].Caption :=T['Wasdenn']; L2[1].Font.Name := 'Lucida Console'; L2[1].Font.Size := 9; L2[1].Font.Style := [fsBold]; L2[1].Top := i*20; L2[1].Left := 85+a; L2[1].Transparent := True;
L3[1] := TLabel.create(Form11); L3[1].parent := Form11; L3[1].Caption :=T['Einheit']; L3[1].Font.Name := 'Lucida Console'; L3[1].Font.Size := 9; L3[1].Font.Style := [fsBold]; L3[1].Top := i*20; L3[1].Left := 285+a; L3[1].Transparent := True;
for Tx := 1 to 27 do begin TE[Tx]:= TEdit.create(Form11); TE[Tx].parent := Form11; TE[Tx].Font.Name := 'Lucida Console'; TE[Tx].Font.Size := 9; TE[Tx].Font.Style := [fsBold]; TE[Tx].Top := i*20; TE[Tx].Left := 335+a; TE[Tx].Width := 25; TE[Tx].OnKeyPress := Edit1KeyPress; end;
inc(i); if i = 27 then begin a := 350; i := 1; end; end; T.next; end; end; |
aber das Programm startert nicht,ich vermute mal es liegt an der
For-Schleife,weil wenn ich sie weglasse,dann geht es,aber ich will,das die dynamischen Editfelder "TE" durchnummeriert werden,damit ich auf jedes einzelne Feld zugreifen kann !
Ist das die richtige Lösung ???
Jagg !