Reputation: 86075
Can we show the windows form for just some specific time span, say 1 minute, then close it automatically?
Upvotes: 5
Views: 4871
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
Reputation: 6689
Yes. Use a System.Windows.Forms.Timer, and when the timer fires, call this.Close().
Upvotes: 0