我在窗体上添加了几个SpeedButton控件,我怎样控制这些SpeedButton在components中的索引值?
也就是说第一个添加的SpeedButton不一定是components[0],我要让第一个添加SpeedButton成为components[1],要怎样写源代码?
请给出源代码,谢谢呀!
也就是说第一个添加的SpeedButton不一定是components[0],我要让第一个添加SpeedButton成为components[1],要怎样写源代码?
请给出源代码,谢谢呀!
var
s: String;
begin
try
for i:=0 to 4 do
begin
s:='SpeedButton' + IntToStr(i);
TSpeedButton(FindComponent(s)).Caption:=IntToStr(i);
end;
except
end;
end;