Click here to Skip to main content
15,867,308 members
Articles / Web Development / HTML

Office 2013 Style Splash Screen

Rate me:
Please Sign up or sign in to vote.
5.00/5 (23 votes)
5 Aug 2014Ms-PL2 min read 44.5K   10.9K   45   6
How to create Office 2013 style splash screen for Windows Forms

Sample Image - maximum width is 600 pixels

Introduction

Many produce programs that are similar to the user interface of renowned Microsoft Office. Many ribbon, skin and other controls are made from a variety of platforms (WPF, Windows Forms, Active X) Microsoft Office model. I am writing about this because I have not seen a lot of these.

How to create Office 2013 style splash screen for Windows Forms? I present the step by step procedure below.

Step 1: Create the Project

Crerate New Project

Create a new Windows Forms application in Visual Studio. Download Metro ProgressBar, and the blue splash background. Create new Windows Forms to your project (Click „Project”->”Add Windows Form...”).

Step 2: Configure Splash Screen Form

Select the new Windows Forms window, set the "FormBorderStyle" property to "None". Select blue splash image to "BackgroundImage". You can use red (than the PowerPoint), green (than the Excel and the Publisher) or own colour background. Minimum and maximum size: width: 439, Height: 248.

Set properties

Step 3: Create the Controls

It should look like:

Create the controls

Step 4: Write the Code

The Program.cs is as follows:

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Office2013StyleSplashScreen
{
    static class Program
    {
        /// 
        /// <summary> 
        /// The main entry point for the application. 
        /// </summary>

        [STAThread] static void Main() 
        { 
            Application.EnableVisualStyles(); 
            Application.SetCompatibleTextRenderingDefault(false); 
            Application.Run(new Splash()); 
        } 
    } 
}

The splash form source code is as follows:

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading.Tasks;
using System.Threading;

namespace Office2013StyleSplashScreen
{
    public partial class Splash : Form
    {
        public Splash()
        {
            InitializeComponent();

            //Tasks
            //Starting
            tasks.Text = "Starting...";
            Thread.Sleep(1000);                   

            //start timer
            splashtime.Start();
        }

        public bool Isminimized = false;

        //Close Application
        private void close_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        //Minimize Application
        private void minimize_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
            Isminimized = true;
        }
        //Mouse hover and leave effects
        private void close_MouseHover(object sender, EventArgs e)
        {
            close.ForeColor = Color.Silver;
        }

        private void close_MouseLeave(object sender, EventArgs e)
        {
            close.ForeColor = Color.White;
        }

        private void minimize_MouseHover(object sender, EventArgs e)
        {
            minimize.ForeColor = Color.Silver;
        }

        private void minimize_MouseLeave(object sender, EventArgs e)
        {
            minimize.ForeColor = Color.White;
        }

        //Show MainForm(Form1)
        public void frmNewFormThread()
        {
            var frmNewForm = new Form1();
            if(Isminimized == true)
            {
                frmNewForm.WindowState = FormWindowState.Minimized;
            }
            else
            {
                frmNewForm.WindowState = FormWindowState.Maximized;
            }
            Application.Run(frmNewForm);
        }

        private void splashtime_Tick(object sender, EventArgs e)
        {
            splashtime.Stop();

            var newThread = new System.Threading.Thread(frmNewFormThread);
            newThread.SetApartmentState(System.Threading.ApartmentState.STA);
            newThread.Start();
            this.Close();
        }            
        }
}

I use this.Close(); method to close splash screen, therefore create new Task to start application general window. Set the thread apartmentstate to STA(newThread.SetApartmentState(System.Threading.ApartmentState.STA);).

You can see the related documentation by clicking on the link below:

The Final Result

The Microsoft Office Word splash screen(left) and My splash screen(right), almost same!

Microsoft Office Word splash My splashscreen

History

Not all programs have splash screen. But if you need or want it to look good, I've done this. I hope that this will be useful for your program!

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Student
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionA WPF version would be highly appreciated Pin
Member 810018012-Dec-17 13:52
Member 810018012-Dec-17 13:52 
Questionhflores Pin
Member 123477607-Mar-16 8:45
Member 123477607-Mar-16 8:45 
AnswerRe: hflores Pin
Magyar András11-Mar-16 9:15
professionalMagyar András11-Mar-16 9:15 
QuestionReally cool splash screen Pin
AllenR13-Aug-14 9:15
professionalAllenR13-Aug-14 9:15 
Questionazmazing Pin
tjnapster5559-Aug-14 23:03
tjnapster5559-Aug-14 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.