Autor Beitrag
JoBoCAD
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 11.04.18 13:43 
Hallo Zusammen,


Über die Procedure text_boxen_ein erstelle ich beliebig viele Editfelder auf einem Form.
Bei Bedarf möchte ich über die Procedure text_boxen_aus die Komponenten zur Laufzeit löschen.

Allerdings wird aktuell nur die letzte Komponenten gelöscht.
Kann mir jemand erklären worin mein Fehler besteht.
ausblenden Delphi-Quelltext
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:
procedure text_boxen_ein;
var
i,count:integer;
begin
    SetLength(form3.EditArray, Count);
    for i:=1 to strtoint(form3.Label2.Caption) do
    begin
      form3.EditArray[i] := TEdit.Create(form3);
      form3.EditArray[i].Parent := Form3;
      form3.EditArray[i].Left := 150;
      form3.EditArray[i].Height:=17;
      form3.EditArray[i].Top := 20 + ((form3.EditArray[i].Height + 2) * i);
    end;
end;



procedure text_boxen_aus;
var
i:integer;

begin


    for i:=1 to strtoint(form3.Label2.Caption) do
    begin
        form3.EditArray[i].Destroy;
    end;

end;


Gruß
Jo

Moderiert von user profile iconNarses: Delphi-Tags hinzugefügt.
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 11.04.18 14:05 
- Nachträglich durch die Entwickler-Ecke gelöscht -
JoBoCAD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Mi 11.04.18 15:16 
Danke für die Infos.
Ich habe die Korrekturen vorgenommen.
Brachte keinen Erfolg.
Ich arbeite noch mit Delphi XE4.
Vermutlich liegt es daran.
Frühlingsrolle
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 11.04.18 16:28 
- Nachträglich durch die Entwickler-Ecke gelöscht -