Splash Screen
1. Create a new project in Visual Studio as in the following:
2. I created a simple Hello World application (MainForm.cs) that will be shown after the splash screen.
3. Add another form that will be used as the splash screen for this project as in the following:
4. Change the Border style of the SplashSreen form to none.
5. Change the start position to the center of the screen so the splash screen displays in the center of the screen.
6. Add a PictureBox to the SplashScreen form using the toolbox. Actually I am using an image for the splash screen (you can try something different).

7. Go to the file program.cs that contains the Main() method and make sure that the program starts with the SplashScreen form.
Application.Run(new SplashScreen());
8. Go to the SplashScreen.cs for the form, click on "Events" and double-click on the "Shown" event as in the following:

9. Add this code:
//Use timer class
Timer tmr;
private void SplashScreen_Shown(object sender, EventArgs e)
{
tmr = new Timer();
//set time interval 3 sec
tmr.Interval = 3000;
//starts the timer
tmr.Start();
tmr.Tick += tmr_Tick;
}
void tmr_Tick(object sender, EventArgs e)
{
//after 3 sec stop the timer
tmr.Stop();
//display mainform
Mainform mf = new Mainform();
mf.Show();
//hide this form
this.Hide();
}
10. Go to the Events for the MainForm.cs form.

Double-click on the FormClosed Event and add this Code:
private void Mainform_FormClosed(object sender, FormClosedEventArgs e)
{
//exit application when form is closed
Application.Exit();
}
Final Preview

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
2021-10-24 为啥有人觉得你写程序写得好,有人觉得你不称职