Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 13.11.02 08:55 
Hallo !

Ich habe folgenden Code :
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.FormCreate(Sender: TObject);
begin
  i := 1;
  for y := 1 to 10 do
  begin
    TE[x]:= TEdit.create(Form1);
    TE[x].parent := Form1;
    TE[x].Font.Name := 'Lucida Console';
    TE[x].Font.Size := 9;
    TE[x].Font.Style := [fsBold];
    TE[x].Top := i*20;
    TE[x].Left := 335;
    TE[x].Width := 25;
    inc(i);
  end;
end;


Wenn ich jetzt starte,dann sagt er mir die Fehlermeldung :
ausblenden Quelltext
1:
Ein Steuerelement kann nicht selbst als Vorfahr haben !					


Ich habe auch den Debugger benutzt,den Fehler sagt zeigt er mir nach der Zeile :
ausblenden Quelltext
1:
TE[x].parent := Form1;					

an.

Könnt ihr mir helfen ?

Jagg !
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 13.11.02 09:25 
Hi Jagg,

was hat das hier in dieser Sparte zu suchen?

Erstmal was ich nicht verstehe ist das Du die Variable X benutzt. Wo und wie ist die deklariert. Ich denke mal statt dem X solltest Du die Variable Y benutzen. Außerdem nimm die Variable I weg und mach es so:
ausblenden Quelltext
1:
TE[x].Top := y*20;					


Gruß
TINO
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 13.11.02 09:28 
Ich habe sie so deklariert :
ausblenden Quelltext
1:
2:
var TE : array [1..10] of TEdit;
    x,i,y  : integer;
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Mi 13.11.02 13:58 
Hast Du Dir meinen Hinweise bzgl. der Variable Y durchgelesen?

Gruß
TINO
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Mi 13.11.02 14:38 
hey ich hab's
danke trotzdem