unit BarEhUnt;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;type
TBarEhFrm = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;Procedure ShowBarEh(const info:Pchar;Delay:integer;owner:Tcomponent);
implementation{$R *.DFM}
Procedure ShowBarEh(const info:Pchar;Delay:integer;owner:Tcomponent);
var
BarEhFrm: TBarEhFrm;
begin
BarEhFrm:=TBarEhFrm.Create(owner);
with BarEhFrm do
begin
try
Label1.Caption:=info;
Width:=Label1.Width+2*Label1.Left;
Timer1.Interval:=Delay;
showmodal;
finally
Free;
end;
end;
end;procedure TBarEhFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;
end;procedure TBarEhFrm.Timer1Timer(Sender: TObject);
begin
Close;
end;////以下是调用李子
uses BarEhUnt;procedure TForm1.Button1Click(Sender: TObject);
begin
ShowBarEh(Pchar(edit1.text),1000,self);
end;
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;type
TBarEhFrm = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;Procedure ShowBarEh(const info:Pchar;Delay:integer;owner:Tcomponent);
implementation{$R *.DFM}
Procedure ShowBarEh(const info:Pchar;Delay:integer;owner:Tcomponent);
var
BarEhFrm: TBarEhFrm;
begin
BarEhFrm:=TBarEhFrm.Create(owner);
with BarEhFrm do
begin
try
Label1.Caption:=info;
Width:=Label1.Width+2*Label1.Left;
Timer1.Interval:=Delay;
showmodal;
finally
Free;
end;
end;
end;procedure TBarEhFrm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action:=cafree;
end;procedure TBarEhFrm.Timer1Timer(Sender: TObject);
begin
Close;
end;////以下是调用李子
uses BarEhUnt;procedure TForm1.Button1Click(Sender: TObject);
begin
ShowBarEh(Pchar(edit1.text),1000,self);
end;
解决方案 »
- 如何在后台打开一个网页
- 窗体上用canvas 方法画线,怎么打开另外的窗体,后面的线就会消失了,怎么处理才能让画的线始终存在呀.或者实现重画也行?
- 有关IIS的虚拟目录的控制总结
- 如何在Delphi中实现“黑屏”?
- 怎样查找大于某个字段,但小于另一个字段的值??如:
- jiangshi99 (僵尸先生99) 请进来看看
- 主从表中的DBGrid数据不显示问题
- oracle 备份
- 请问如何实现瑞星2002中的狮子功能?(大虾进)
- delphi可以 反编译?
- 请大家赐教!我最近接了软件公司的业务,做一个中小型的MIS系统,请大家进来看看!
- 请问 各位大侠谁买到D版的 delphi6.0 中文版了?不是汉化版了。
建立两个窗体Form1 Form2,把Form2有自动创建变为手动创建
让后在Form1 OnShow中加下面的代码
with TForm2.Create(Form2) do
begin
show;
sleep(2000);
free;
end;
注意要加上uses unit2;