H
HHBBSS
Unregistered / Unconfirmed
GUEST, unregistred user!
我用
var b:tbutton;
i:integer;
begin
for i :=1 to 4 do
begin
b:=tbutton.Create(self);
b.Name :='ok'+inttostr(i);
b.Top :=100+i*10;
b.left:=100;
b.Width :=100;
b.Height :=30;
b.Parent :=form1;
end;
动态创建了几个按钮,
但我不知道如何动态卸掉他们,我用了很多办法,
其中
var
j:integer;
begin
for j:=1 to form1.ControlCount do
begin
if form1.Controls[j].ClassName='Tbutton'then
form1.Controls[j].Destroy
end;
end;
可老是报错,说list index out of bounds(8),不明白,我的窗体上加上按钮一共才6个
控件对象,那里来的8,help!!!!!!!!!!!!!!!!!!!
var b:tbutton;
i:integer;
begin
for i :=1 to 4 do
begin
b:=tbutton.Create(self);
b.Name :='ok'+inttostr(i);
b.Top :=100+i*10;
b.left:=100;
b.Width :=100;
b.Height :=30;
b.Parent :=form1;
end;
动态创建了几个按钮,
但我不知道如何动态卸掉他们,我用了很多办法,
其中
var
j:integer;
begin
for j:=1 to form1.ControlCount do
begin
if form1.Controls[j].ClassName='Tbutton'then
form1.Controls[j].Destroy
end;
end;
可老是报错,说list index out of bounds(8),不明白,我的窗体上加上按钮一共才6个
控件对象,那里来的8,help!!!!!!!!!!!!!!!!!!!