As usual i'll try to keep my code as simple as possible, but just as good i hope =)
Will add screenies later.
First create a new C# project by going to
File>New>C#>Windows Form Application
Now add a new form by right clicking on the project in the solution explorer, and add a new "Windows Form" called "Splash".
Now add a timer on the "Splash" form, with its interval set at 3000. You can change that at the timer's Properties.
Now you're gonna have to change your startup form, from Form1, to splash, you can achieve that by editing "Program.cs" code, from
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Splash_Screen
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
To
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace Splash_Screen
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new [COLOR="Red"]Splash[/COLOR]());
}
}
}
Now goto Splash's main code, and under
InitializeComponent();
add
timer1.Enabled = true;
And add this to "timer1"'s code
Form1 MainForm = new Form1; MainForm.Show; timer1.Enabled = false; this.Dispose(false);
Go back to Form1 now, and click the "Events" button (Looks like a lightning icon), and scroll down to "FormClosed", and double click it, it should bring you to the code editor. Now add this code
Application.Exit();
The reason behind this is because when Splash closes, its actually still running in the background, but just not visible, as because it is the startup form, which C# thinks is the main form, but by adding this code whenever your Form1 closes the whole application closes.
Now for the GUI =D
Set "Splash"'s "FormBorderStyle" to "Borderless", and "TopMost" to yes, and "ShowInTaskbar" to no.
Then resize your Splash form to whatever size you like, and add a picture or background, and ur done =)
Hope you found this usefull.
~kierien


Sign In
Create Account


Back to top









