0

How can I have a Animated splash screen in C#

But I could still make a splash (Fixed)

private void SplashScreen()
{
    Application.Run(new Splash());
}
Rajesh Dhiman
  • 1,888
  • 1
  • 17
  • 30
  • Looks like you are on the correct track. Your code suggest you have a form (view) by the name Splash. All you have to do is to apply your animation logic to Splash – Chintana Meegamarachchi Mar 24 '14 at 14:58

1 Answers1

0

A few steps for WPF:

add a new window to your project and call it splash.

in the app.xaml remove the startupwindow, and register an event for startup.

in the app.xaml.cs add the following code.

    private void App_OnStartup(object sender, StartupEventArgs e)
    {
        var splash = new Splash();
        var mainwindow = new MainWindow();
        splash.ShowDialog();
        mainwindow.Show();
    }

Now the first window splash is opened and in that window you can do some animations. After that window is closed (by the user or by using a timer and calling the close method.) the mainwindow will open.

A few notes you will have to set various properties in the splash window.

TopMost = true StartupLocation = CenterScreen WindowStyle = none

Play around with that window to get the desired effects.

woutervs
  • 1,500
  • 12
  • 28