首先当然要定义哪一个启动,我们先新建好一个窗体,比如窗体名字叫Splash
然后需要双击项目中的 Program.cs 文件
可以见到下面 最后一行即是启动的窗体了:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Splash());
}
正好也知道了 Main函数是在 Program.cs 文件 中
这样既可启动
当然,在Splash的文件中,放一个timer控件,设置好他的Enable属性为true,调整好间隔
写出如下代码:
private void timer1_Tick(object sender, EventArgs e)
{
Form1 frm1 = new Form1();
frm1.Show();
this.Hide();
this.timer1.Enabled = false;
}