如何删除已创建的标签。我尝试使用
FindComponent
但失败了,我该怎么办?应该将其父级设置为其他组件,比如TPanel吗?procedure TForm1.Button1Click(Sender: TObject);
var
lblLink: TLabel;
begin
for i := 0 to stringtList.Count-1 do
begin
lblLink := TLabel.create(self);
with lblLink do
begin
name:='lblLink'+inttostr(i);
caption:inttostr(i);
Parent := self;
font.style := [fsUnderline];
cursor := crHandPoint;
color := clBlue;
font.Color := clBlue;
end;
end;
end;
stringtList
的计数,这显然是不稳定的。 - Аймен Ахмед