Fórum Limpar Flowpanel #511052
18/02/2015
0
Estou fazendo o curso de iniciante de Delphi e tem um exercício para criar Label e Edit no flowpanel conforme código abaixo:
var
I : Integer;
L : TLabel;
E : TEdit;
begin
for I := 1 to 10 do
begin
FlowPanel1.FlowStyle := fsTopBottomLeftRight;
L := TLabel.Create(Self);
L.Parent := FlowPanel1;
L.Caption := 'Controlar' + ' ' + IntToStr(I);
L.Margins.Top := 2;
L.AlignWithMargins := True;
E := TEdit.Create(Self);
E.Parent := FlowPanel1;
E.Margins.Top := 0;
E.AlignWithMargins := True;
end;
Até ai tudo bem.
O que é quero saber é como eu faço para limpar o flowpanel na próxima vez que eu clicar no botão criar.
var
I : Integer;
L : TLabel;
E : TEdit;
begin
for I := 1 to 10 do
begin
FlowPanel1.FlowStyle := fsTopBottomLeftRight;
L := TLabel.Create(Self);
L.Parent := FlowPanel1;
L.Caption := 'Controlar' + ' ' + IntToStr(I);
L.Margins.Top := 2;
L.AlignWithMargins := True;
E := TEdit.Create(Self);
E.Parent := FlowPanel1;
E.Margins.Top := 0;
E.AlignWithMargins := True;
end;
Até ai tudo bem.
O que é quero saber é como eu faço para limpar o flowpanel na próxima vez que eu clicar no botão criar.
David Sobral
Curtir tópico
+ 0
Responder
Posts
19/02/2015
Ricardo
Tente
E.free
L.free
E.free
L.free
Responder
Gostei + 0
03/03/2015
David Sobral
Ricardo coloquei o código mencionado e não deu certo.
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)