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?
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();
}
Use a Timer
, let it close the form after the amount of time you need it to.
Yes. Use a System.Windows.Forms.Timer, and when the timer fires, call this.Close().
精彩评论