📜  固定时间后关闭表单 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:03.034000             🧑  作者: Mango

代码示例1
System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
private void Form1_Load(object sender, EventArgs e)
{
  timer.Interval = 10000;
  timer.Tick += new EventHandler(timer_Tick);
  timer.Start();
}

void timer_Tick(object sender, EventArgs e)
{
  this.Close();
}