frmpubwaitstaticunt.pas

来自「EAComps手工画报表 对写报表编辑器有一定的参考价值」· PAS 代码 · 共 73 行

PAS
73
字号
{ 只显示一个消息等待框 }
unit frmPubWaitStaticUnt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmPubWaitStatic = class(TForm)
    labMsg: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  procedure ShowPubWaitStaticDlg(const ACaption: string = '请等待...';
    const AMsgText: string = '系统处理中,请等待...'; AWidth: Integer = 399;
    AHeight: Integer = 82);
  procedure ClosePubWaitStaticDlg;
  procedure UpdateWaitStaticCaption(const ACaption: string);
  procedure UpdateWaitStaticProgress(const AMsgText: string);

var
  frmPubWaitStatic: TfrmPubWaitStatic;

implementation

{$R *.dfm}

procedure ShowPubWaitStaticDlg(const ACaption, AMsgText: string;
  AWidth, AHeight: Integer);
begin
  if frmPubWaitStatic = nil then
    frmPubWaitStatic := TfrmPubWaitStatic.Create(Application);
  with frmPubWaitStatic do
  begin
    Caption := ACaption;
    labMsg.Caption := AMsgText;
    Show;
  end;
  Application.ProcessMessages;
end;

procedure ClosePubWaitStaticDlg;   
begin
  if frmPubWaitStatic <> nil then
    with frmPubWaitStatic do
    begin
      Free;
      frmPubWaitStatic := nil;
    end;
end;

procedure UpdateWaitStaticCaption(const ACaption: string);  
begin
  with frmPubWaitStatic do
    Caption := ACaption;
  Application.ProcessMessages;
end;

procedure UpdateWaitStaticProgress(const AMsgText: string);
begin
  with frmPubWaitStatic do
    labMsg.Caption := AMsgText;
  Application.ProcessMessages;
end;


end.

⌨️ 快捷键说明

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