关于ProgressForm的bug
当在一个showmodal的窗体上用这个进度条时,关闭后showmodal的窗体会变成不是showmodal的,
这时点主窗体可以把这showmodal窗体给隐藏掉,
原因就是这个的formlist被禁窗体引起的
如图修改代码就不会出现这种问题
procedure ShowProgress(Aowner:TComponent;const Title: string);
var
i: Integer;
begin
if not Assigned(ProgressForm) then
ProgressForm := TProgressForm.Create(Aowner)
else
ProgressForm.BringToFront;
if Title<>'' then
ProgressForm.lblTitle.Caption := Title;
ProgressForm.Show;
//这里不用那个循环
WindowList:=DisableTaskWindows(ProgressForm.Handle);
ProgressForm.Update;
end;
procedure HideProgress;
var
i: Integer;
begin
if not Assigned(ProgressForm) then Exit;
//关闭改为这样
EnableTaskWindows(WindowList);
ProgressForm.Close;
Application.ProcessMessages;
ProgressForm.Free;
ProgressForm := nil;
end;
|