Autor Beitrag
sahib
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117

Win 2000 SP4+
Delphi 5 Prof.
BeitragVerfasst: Mi 25.05.05 23:01 
Hallo.

Zur Laufzeit generiere ich auf einer ScrollBox einige Komponenten. Diese sollen später entfernt werden, damit ich nadere darauf plazieren kann. Leider sind die ursprünglichen dann aber noch da.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
  // Erzeugen, x-mal, in TList abspeichern
     OneGauge := TGauge.Create(ScrollBox1);
     with OneGauge do begin
       Left := 5;
       Top := PosY;
       Width := 100;
       Height := 16;
       Parent := ScrollBox1
     end;
     inc(PosY);

  // Entfernen
  for i := Pred(ScrollBox1.ComponentCount) downto 0 do
    ScrollBox1.RemoveComponent(ScrollBox1.Components[i]);
  MeineTList.Clear;

Wo könnte der Fehler liegen?

Christian
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 25.05.05 23:47 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  // TGauge zu ScrollBox1 hinzufügen

  with TGauge.Create(ScrollBox1) do
  begin
    Parent := ScrollBox1;
    Left := 5;
    Top := PosY;
    Width := 100;
    Height := 16;
  end;

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
  // TGauge's aus ScrollBox1 entfernen

  with ScrollBox1 do
    for I := ComponentCount - 1 downto 0 do
      if Components[I] is TGauge then
        Components[I].Free;

_________________
Ciao, Sprint.
sahib Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 117

Win 2000 SP4+
Delphi 5 Prof.
BeitragVerfasst: Do 26.05.05 00:52 
Vielen Dank, Sprint. Das ist eine funktionierende Lösung. Dein Name ist Programm ;)

Christian