Open Visual Studio.
File-->New Project.
In the dialog box, choose windows forms application.
Form1.cs design page will be open.
After that design a form listed below:
File-->New Project.
In the dialog box, choose windows forms application.
Form1.cs design page will be open.
After that design a form listed below:
Add another form that will be used as the splash screen for this project. And name it as SplashScreen.cs .
Go to the properties of SplashScreen.cs and Change the FormBorderStyle to None. As well as change StartPosition to CenterScreen.
Now add PictureBox to SplashScreen form and add picture in the PictureBox as below :
Go to the file program.cs that contains the Main() method and make sure that the program starts with the SplashScreen form. Like :-
Application.Run(new SplashScreen());
Go to the SplashScreen form, click on "Events" and double-click on the "Shown" event.
Now add this Code there :-
public partial class SplashScreen : Form
{
Timer t;
public SplashScreen()
{
InitializeComponent();
}
private void SplashScreen_Shown(object sender, EventArgs e)
{
t = new Timer();
t.Interval=5000;
t.Start();
t.Tick += Tick1;
}
void Tick1(object sender, EventArgs e)
{
t.Stop();
Form1 f = new Form1();
f.Show();
this.Hide();
}
}
Now save all files and run the project... :)
No comments:
Post a Comment