How to make Splash Screen?
-
Hello everyone, I am trying to add a Splash Screen to my Windows Application. I have searched the internet and I have came across "A Pretty Good Splash Screen in C#" by Tom Clement. As I tried to follow the Tom's tutorial, I came to the point that he asks, "Add a Windows Form to the project and name it SplashScreen. Delete Form1.cs.". I am wondering if I delete my Windows Form, then what I am making the splash screen for?!!! I am puzzled and I was wondering if someone can help me out on this. Thank you very much and have a great day. Khoramdin
-
Hello everyone, I am trying to add a Splash Screen to my Windows Application. I have searched the internet and I have came across "A Pretty Good Splash Screen in C#" by Tom Clement. As I tried to follow the Tom's tutorial, I came to the point that he asks, "Add a Windows Form to the project and name it SplashScreen. Delete Form1.cs.". I am wondering if I delete my Windows Form, then what I am making the splash screen for?!!! I am puzzled and I was wondering if someone can help me out on this. Thank you very much and have a great day. Khoramdin
Here is one of the easiest one: In your main Program.cs call a Form: --Name that form splash screen, --Set the property 'FormBorderStyle' = 'None' --call a method show splash so basically you will write as below: public SplashForm() { InitializeComponent(); } public void ShowSplash() { Thread.Sleep(1000); this.Close(); } Now in main write this: SplashForm f2 = new SplashForm(); f2.Show(); f2.ShowSplash(); This will work as a splash screen!!
-
Hello everyone, I am trying to add a Splash Screen to my Windows Application. I have searched the internet and I have came across "A Pretty Good Splash Screen in C#" by Tom Clement. As I tried to follow the Tom's tutorial, I came to the point that he asks, "Add a Windows Form to the project and name it SplashScreen. Delete Form1.cs.". I am wondering if I delete my Windows Form, then what I am making the splash screen for?!!! I am puzzled and I was wondering if someone can help me out on this. Thank you very much and have a great day. Khoramdin
Better ask your question to Tom Clement itself instead of posting it here. there is a Discussion board below the article.
Regards, Satips.:rose: Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Walk beside me, and just be my friend. - Albert Camus
-
Hello everyone, I am trying to add a Splash Screen to my Windows Application. I have searched the internet and I have came across "A Pretty Good Splash Screen in C#" by Tom Clement. As I tried to follow the Tom's tutorial, I came to the point that he asks, "Add a Windows Form to the project and name it SplashScreen. Delete Form1.cs.". I am wondering if I delete my Windows Form, then what I am making the splash screen for?!!! I am puzzled and I was wondering if someone can help me out on this. Thank you very much and have a great day. Khoramdin
Try this it is workin on my project its also from "A Pretty Good Splash Screen in C#" by Tom Clement.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace GasDistributionManagement { public partial class SplashScreen : Form { static int var =0; public SplashScreen() { InitializeComponent(); } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { } private void SplashScreen_Load(object sender, EventArgs e) { this.ClientSize = this.BackgroundImage.Size; timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { var++; progressBar1.Value++; if (progressBar1.Value != 100) { int i = 1 + ((100 - var) / 8); if (i / 3 > 2) { Timelabel.ForeColor = System.Drawing.Color.DarkViolet; Timelabel.Text = "Time Remaining is " + i + " Seconds"; } else if (i / 3 == 2) { Timelabel.ForeColor = System.Drawing.Color.Red; Timelabel.Text = "Time Remaining is " + i + " Seconds"; } else { Timelabel.ForeColor = System.Drawing.Color.DarkKhaki; Timelabel.Text = "Time Remaining is " + i + " Seconds"; } } else { timer1.Stop(); this.Hide(); Login log = new Login(); log.Show(); } } } }