本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
PopForm:TForm;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
PopForm:=TForm.Create(self);
PopForm.Width:=200;
PopForm.Height:=150;
PopForm.Name:='PopForm1';
PopForm.Left:=screen.Width-PopForm.Width;
PopForm.Top:=screen.Height;
PopForm.Show;
Timer1.Interval:=200;
Timer1.Enabled:=True;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
PopForm.Top:=PopForm.Top-10;
if PopForm.Top<screen.Height-PopForm.Height then
begin
Timer1.Enabled:=False;
PopForm.Free;
end;
end;
//需要说明的是只要触发按钮的单击事件 就可显示信息
相关阅读 >>
更多相关阅读请进入《Delphi》频道 >>