Autor Beitrag
Millo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Di 07.01.03 23:45 
Moin,

ich hätte nur mal kurz ne frage wie ich eine Komponente zur Laufzeit Löschen kann ich habs so probiert:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var Z : Integer;
    C : TComponent;
begin
  for Z := ComponentCount - 1 downto 0 do
  begin
    C:= Components[Z];
    if (C is TLabel) then
    begin
      RemoveComponent(C);
    end;
  end;
end;

Aber das haut nicht hin ich hab es auch mit Free versucht und dann Destroy aber das wollt auch nicht. Vielleicht wird die Form auch nicht aktuallisiert zumindest verschwinden das Label net,
Popov
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mi 08.01.03 01:13 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var Z : Integer; 
    C : TComponent; 
begin 
  for Z := ComponentCount - 1 downto 0 do 
  begin 
    C:= Components[Z]; 
    if (C is TLabel) then 
    begin 
      TLabel(C).Free; 
      //das gleiche wie (C as TLabel).Free;
    end; 
  end; 
end;
Millo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 147



BeitragVerfasst: Mi 08.01.03 15:47 
THX das klapp prima.