Jump to content

  •  

  • iBotModz CBox


    Photo

    Creating a SplashScreen in C#


    This topic has been archived. This means that you cannot reply to this topic.
    No replies to this topic

    #1 xXxStevenxXx

    xXxStevenxXx

      Corporal Grade 1

    • Donors

    • 202 posts
    • Joined: 29-June 08

    Posted 09 November 2009 - 08:25 PM

    1.) Let's start by creating a new C# Windows Application ( File -> New -> Project -> Windows Application ). Name the project SplashScreen.

    2.) Let's leave the current form the way it is and add to our project another form. To do this, go to Project menu and click Add Windows Form. Name the class Splash.cs and click OK.

    3.) Let's set the Slash Form FormBorderStyle to None its StartPosition to CenterScreen.

    4.) Be sure to add this
    using System.Threading;
    on your Form1

    5.) Now go to Form1() method. Add The following code right bellow the call to InitializeComponent method
    Thread th = new Thread(new ThreadStart(DoSplash));
    th.Start();
    Thread.Sleep(3000);
    th.Abort();
    Thread.Sleep(1000);
    This let the SplashScreen sits for 3 sec then another sec so thats 4 sec before the Form1 shows.


    6.) Now lets make the DoSplash Command. Put this following code anywhere in your Form1
    private void DoSplash()
     {
     Splash sp = new Splash();
     sp.ShowDialog();
     }

    And Your Done Enjoy I will include an project file
    Attached File  SplashScreen.rar   1.36MB   240 downloads