user496949
user496949

Reputation: 86075

Is there a way to display a form for just some specific time

Can we show the windows form for just some specific time span, say 1 minute, then close it automatically?

Upvotes: 5

Views: 4871

Answers (3)

Bala R
Bala R

Reputation: 108947

Add a Timer control from Toolbox. Set some attributes.

    this.timer1.Enabled = true;
    this.timer1.Interval = 60000;
    this.timer1.Tick += new System.EventHandler(this.timer1_Tick);

and define Tick event handler

    private void timer1_Tick(object sender, EventArgs e)
    {
        Close();
    }

Upvotes: 8

John Arlen
John Arlen

Reputation: 6689

Yes. Use a System.Windows.Forms.Timer, and when the timer fires, call this.Close().

Upvotes: 0

Femaref
Femaref

Reputation: 61437

Use a Timer, let it close the form after the amount of time you need it to.

Upvotes: 1

Related Questions