Delphi窗体的隐藏和显示

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
  Application.ShowMainForm:=False;        //隐藏窗体
  Beep;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
 Application.ShowMainForm:=True;          //允许显示窗体
 Application.MainForm.Show();             //显示窗体 
 Timer1.Enabled:=False;
end;



end.

转载于:https://www.cnblogs.com/qingsong/archive/2012/08/06/2625416.html

你可能感兴趣的:(Delphi窗体的隐藏和显示)