Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

winforms

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

like image 324
user496949 Avatar asked Feb 26 '11 01:02

user496949


2 Answers

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();
    }
like image 145
Bala R Avatar answered Nov 15 '22 11:11

Bala R


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

like image 21
Femaref Avatar answered Nov 15 '22 11:11

Femaref