procedure TAddProgressbarFrm.AddProgressToStatus;var i,Count,StatusPanelWidth: Integer;begin FProgress := TProgressbar.Create(AddProgressbarFrm); {定义进程条的最大值} Count := 3000; StatusPanelWidth := Status.Panels.Items[2].Width; {改变进度条宽度} Status.Panels.Items[2].Width := 150; Status.Repaint; with FProgress do begin Top := FStatusDrawRect.Top; Left := FStatusDrawRect.Left; {设定进程条的宽度和高度} Width := FStatusDrawRect.Right - FStatusDrawRect.Left; Height := FStatusDrawRect.Bottom - FStatusDrawRect.Top; Visible := True; try Parent := Status; {进程条的最小和最大值} Min := 0; Max := Count; Step := 1; for i := 1 to Count do Stepit; MessageBox(Handle,#13+‘现在,进程条将要从内存中被释放‘+#13+#13 +‘ [刀剑如梦软件创作室]‘,‘信息提示‘,MB_OK+MB_ICONINFORMATION); finally {从内存中释放进程条} Free; end; end; {恢复状态条的宽度} Status.Panels.Items[2].Width := StatusPanelWidth;end;
1