Is there a way to display a form in just a certain amount of time?

Can we show the window shape only for a certain period of time, say 1 minute, and then close it automatically?

+5
source share
3 answers

Add a Timer control from the toolbar. Set some attributes.

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

and define a Tick event handler

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

Use Timerto close the form after you need it.

+1
source

. System.Windows.Forms.Timer, , this.Close().

0

All Articles