for i := 0 to 207 do
begin
TPanel.Create(Self).Name := 'MyPanel'+ IntToStr(i);
with TPanel(FindComponent('MyPanel'+ IntToStr(i))) do
begin
Parent := Form1;
Left := 10;
Top := i*160+30;
Width := 60;
end;
end;在203个之后,panel的位置就不对了,为什么啊...急死了
begin
TPanel.Create(Self).Name := 'MyPanel'+ IntToStr(i);
with TPanel(FindComponent('MyPanel'+ IntToStr(i))) do
begin
Parent := Form1;
Left := 10;
Top := i*160+30;
Width := 60;
end;
end;在203个之后,panel的位置就不对了,为什么啊...急死了
你有什么需求一定要建1000个左右
Top := i*160+30;这个值这么大 反正在界面看不到,不如少建几个,需要显示时 才创建对应的
因为是用来做题复习,所以只要没关软件,前面做过的题都要留着能查看,用这个就要套不少容器进去了。
界面打开要全屏显示,自动适应屏幕
for i := 0 to 207 do
begin
TPanel.Create(Self).Name := 'MyPanel'+ IntToStr(i);
with TPanel(FindComponent('MyPanel'+ IntToStr(i))) do
begin
Parent := Form1;
Left := 10;
Top := i*160+30;
Width := 60;
end;
end;var pnl:TPanel;
for i := 0 to 207 do
begin
pnl TPanel.Create(Self);
pnl.Name := 'MyPanel'+ IntToStr(i);
with pnl do
begin
Parent := Form1;
Left := 10;
Top := i*160+30;
Width := 60;
end;
end;
改成这样试试,你用findcomponent会降低程序的性能,可能这里会导致出错把