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;