qrprgres.pas

来自「delphi7报表打印控件源码 可以设计报表」· PAS 代码 · 共 54 行

PAS
54
字号
{ :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  :: QuickReport 4.0 for Delphi and C+Builder                ::
  ::                                                         ::
  :: QRPrgres.pas - Foreground printing progress form        ::
  ::                                                         ::
  :: Copyright (c) 2001 A Lochert                            ::
  :: All Rights Reserved                                     ::
  ::                                                         ::
  :: web: http://www.qusoft.no                               ::
  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }

unit QRPrgres;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls, QRPrntr, QR4Const;

type
  TQRProgressForm = class(TForm)
    Info: TLabel;
    CancelButton: TButton;
    Gauge: TProgressBar;
    procedure CancelButtonClick(Sender: TObject);
  private
    FQRPrinter : TQRPrinter;
  protected
    procedure CMQRPROGRESSUPDATE(var Message); message CM_QRPROGRESSUPDATE;
  public
    property QRPrinter : TQRPrinter read FQRPrinter write FQRPrinter;
  end;

implementation

{$R *.DFM}

procedure TQRProgressForm.CMQRPROGRESSUPDATE(var Message);
begin
  if (FQRPrinter.Progress mod 5) = 0 then
  begin
    Gauge.Position := FQRPrinter.Progress;
    Info.Caption := IntToStr(FQRPrinter.Progress)+'% ' + SqrCompleted;
    Application.ProcessMessages;
  end;
end;

procedure TQRProgressForm.CancelButtonClick(Sender: TObject);
begin
  FQRPrinter.Cancel;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?