unit HideForTime;

interface

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

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Button1: TButton;
    MaskEdit1: TMaskEdit;
    procedure Timer1Timer(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: HideForTime
// Property: ExtCtrls.TTimer.Interval
// Method: Forms.TCustomForm.Hide

// BeginCode
{
This code uses a button, a timer and a maskedit on a
form. When the user clicks the button, the form
disappears for the period of time specified in the
Interval property of the timer control, then the form
reappears:
}
procedure TForm1.Button1Click(Sender: TObject);
begin
  Timer1.Interval := StrtoInt(MaskEdit1.Text);
  Timer1.Enabled := True;
  Hide;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Visible := True;
  Timer1.Enabled := False;
end;
// EndCode
// EndExample: HideForTime
end.
