flogo.pas

来自「delphi2007开发的汽车配件进销存系统.实用级的源码.」· PAS 代码 · 共 70 行

PAS
70
字号
unit Flogo;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, cxControls, cxContainer, cxEdit, cxProgressBar, jpeg,
  cxLabel, Gauges, Menus, cxLookAndFeelPainters, StdCtrls, cxButtons;

type
  Tfrmlogo = class(TForm)
    Image1: TImage;
    lblStatus: TcxLabel;
    cxProgressBar1: TcxProgressBar;
    cxButton1: TcxButton;
    procedure cxButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure BeginLoad;
    procedure EndLoad;
    procedure UpdateLoadStatus(const AStatusText: string; AProgress: Integer);
    procedure RepaintForm;
  end;

var
  frmlogo: Tfrmlogo;

implementation

{$R *.dfm}


procedure Tfrmlogo.BeginLoad;
begin
  lblStatus.Caption := '正在装载……';
  cxProgressBar1.Position:=0;
  RepaintForm;
end;

procedure Tfrmlogo.cxButton1Click(Sender: TObject);
begin
  Close;
end;

procedure Tfrmlogo.EndLoad;
begin
  lblStatus.Caption := '装载完毕';
  cxProgressBar1.Position := 100;
  RepaintForm;
end;

procedure Tfrmlogo.RepaintForm;
begin
  Show;
  Update;
  Sleep(50); //为了演示,特延长时间。
end;

procedure Tfrmlogo.UpdateLoadStatus(const AStatusText: string;
  AProgress: Integer);
begin
  lblStatus.Caption := AStatusText;
  cxProgressBar1.Position:= AProgress;
  RepaintForm;
end;

end.

⌨️ 快捷键说明

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