老大,用下面的代码没问题,
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
randomize;
for i := 0 to componentcount-1 do
begin
if components[i].ClassType = TEdit then
begin
TEdit(components[i]).Text := inttostr(random(9))+'*'+inttostr(random(9))+'=';
end;
end;
end;
而且不受edit个数的限定哟!
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
randomize;
for i := 0 to componentcount-1 do
begin
if components[i].ClassType = TEdit then
begin
TEdit(components[i]).Text := inttostr(random(9))+'*'+inttostr(random(9))+'=';
end;
end;
end;
而且不受edit个数的限定哟!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货