Show Waiting Status (Without Thread)
来源:互联网 发布:买车后要下载的软件 编辑:程序博客网 时间:2024/05/20 09:48
{
When user click button, a window will showup with a Animate, progressbar, and a updated time label;
}
unit fMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i, j: Integer;
begin
ShowStatus;
try
for i := 0 to 500000 do
begin
for j := 0 to 8000 do;
Application.ProcessMessages;
end;
finally
HideStatus;
end;
end;
end.
////////////////////////////////////////////////////////////////////
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, MPlayer;
type
TForm2 = class(TForm)
Timer1: TTimer;
Panel1: TPanel;
Label1: TLabel;
ProgressBar1: TProgressBar;
Animate1: TAnimate;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure ShowStatus;
procedure HideStatus;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure ShowStatus;
begin
Form2 := TForm2.Create(Application);
Form2.Show;
Screen.Cursor := crHourGlass;
end;
procedure HideStatus;
begin
Form2.Close;
Screen.Cursor := crDefault;
end;
procedure TForm2.FormDestroy(Sender: TObject);
begin
Form2 := nil;
end;
procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
procedure TForm2.Timer1Timer(Sender: TObject);
begin
Label1.Caption := FormatDateTime('hh:mm:ss', Now);
ProgressBar1.StepIt;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
Label1.Caption := '';
Animate1.CommonAVI := aviFindFolder;
Animate1.Active := true;
end;
end.
- Show Waiting Status (Without Thread)
- MySQL - SHOW TABLE STATUS
- SHOW INNODB STATUS详解
- Mysql show status
- show status 详解
- mysql show status
- SHOW INNODB STATUS 分析
- mysql show status详解
- show innodb status (mysql)
- mysql show status详解
- show slave status 解释
- MYSQL-SHOW STATUS
- show status说明
- SHOW SLAVE STATUS 详解
- mysql show status 总结
- MySQL的SHOW STATUS
- mysql show status详解
- show slave status 详解
- 日期时间段
- 把sql表导入oracle库中
- DLL(动态链接库)专题
- [转]freemarker 基本指令
- RowFiler支持的语法(函数)
- Show Waiting Status (Without Thread)
- velocity的官方地址
- 关于数据结构
- 请不要做浮躁的人!!!
- 一个人人到底做了什么
- MSSQL Server 2000的安全及管理
- C#字符串函数
- 程序员不是神,心态决定一切
- 中国缺乏真正CIO (zt)