在循环中再加入一个判断,判断是否点击了停止按钮,如下var
FStop: boolean;
procedure TForm1.StopClick(...);
begin
FStop := true;
end;procedure TForm1......(....);
var
i: integer;
begin
i := 1;
progressbar.max := 10000;
while (i <=10000) and (not FStop) then
begin
progressbar.position := i;
inc(i);
end;
end;
end;
FStop: boolean;
procedure TForm1.StopClick(...);
begin
FStop := true;
end;procedure TForm1......(....);
var
i: integer;
begin
i := 1;
progressbar.max := 10000;
while (i <=10000) and (not FStop) then
begin
progressbar.position := i;
inc(i);
end;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货