【发布时间】:2019-07-08 02:58:20
【问题描述】:
我尝试关闭 from 并使用此代码再次打开它,但它没有关闭我在后台找到的表单并为它打开另一个表单
private void Graph_Load(object sender, EventArgs e)
{
System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer();
timer1.Interval = 60000;//1 minutes
timer1.Tick += new System.EventHandler(Timer1_Tick);
timer1.Start();
}
private void Timer1_Tick(object sender, EventArgs e)
{
//do whatever you want
RefreshMyForm();
}
private void RefreshMyForm()
{
this.Close();
Graph1 graph = new Graph1();
graph.Show();
}
【问题讨论】:
-
我不认为有
this.close();小写c的方法。 -
@SeM 抱歉,我更新了我的问题,谢谢
-
你为什么要这样做?
-
@SeM 我想这样做来刷新我的表单