我知道这不是已知的动画问题,因为该栏已设置为 pbsPaused 并且 SmoothReverse 为 true。该栏由通过 ftp 发送文件的函数调用。它看起来像这样:
function sendLists(FTP: TIdftp; cBox: TComboBox): Boolean; Overload; // this sends ALL lists from combobox to ftp server
var
i, k: Integer;
idList, resList, filesList: TStringList;
begin
Result:=TRUE;
resList:=TStringList.Create;
filesList:=TStringList.Create;
progress.fmBar.Init(filesList, 0, filesList.Count, 1);// this initiates the bar (files, min, max, step)
for i := 0 to cBox.Items.Count-1 do //comboBox has 4 items in
begin
for k := 0 to idList.Count-1 do
begin
if (something is true) then
resList.Add(idList[k]);
end;
resList.SaveToFile('temp.dat');
resList.Clear;
progress.fmBar.StepBar;//this should be called 4 times
FTP.Put('temp.dat', cBox.Items[i]+'-List.dat'); //the 4 files are sent successfully so that confirms 4 passes are being done.
end;
resList.Free;
filesList.Free;
FTP.Disconnect;
end;
StepBar 是这样的:
procedure Tfmbar.StepBar;
begin
pbMain.StepIt;
if pbMain.Position=pbMain.Max then btOk.Enabled:=TRUE;
pbMain.Update;
fmBar.Update;
end;
标签正确显示 100%,我测试了 pbMain.Position 和 pbMain.Max 都显示 4,在这种情况下是要发送的文件数。我在另一个任务中使用了相同的功能,它完美更新。也许我错过了什么?