HideForTime (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This code uses a button, a timer, and a maskedit on a form. When you click the button, the form disappears for the period of time specified in the Interval property of the timer control, then the form reappears.

Code

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;

Uses