本文介绍了如何在Windows窗体应用程序的加载事件中应用计时器控件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的Windows窗体应用程序中,我想申请一个表格,该表格将是第一个具有软件名称和其他简要信息的表格。当用户运行应用程序时,将首先启动该表单,然后在几秒钟后该表单将自动隐藏,并且将启动主页。我不知道该怎么做?
请有人帮忙。
In my Windows Form Application, I want to apply a form which will be the first form having the software name and other brief information. When the user will run the application, that form will be started first, then after a few seconds that form will be hidden automatically and the homepage will be started. I don't know how to do this?
Please someone help.
推荐答案
private void MainFrm_Load(object sender, EventArgs e) { timer1.Tick += new EventHandler(timer1_Tick);
timer1.Enabled = true;
timer1.Interval = 4000;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Stop();
this.Hide();
HomeFrm f = new HomeFrm();
f.ShowDialog();
}
谢谢,
SP
Thanks,
SP
这篇关于如何在Windows窗体应用程序的加载事件中应用计时器控件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!