I recently added a splash screen to my WPF app.My app loads fast so the screen is only on for milliseconds.How would i lengthen the time my splash screen stays up.I would like it to be two seconds.
Time interval settings The splash screen will be displayed for a specific time period and will then be closed. By default, the value will be set as 5000. User can change this value, run the application and see the difference. The time interval for which the splash screen is to be displayed (in milliseconds).
Duration: We recommend not exceeding 1,000 ms on phones. You can use a delayed start, but this can't be longer than 166 ms. If the app startup time is longer than 1,000 ms, consider a looping animation.
The entire duration of the Splash Screen is the total of all logos plus 0.5 seconds for fading out. This might be longer if the first Scene is not ready to play, in which case the Splash Screen shows only the background image or color and then fades out when the first Scene is ready to play.
Create and Customize Splash Screen at Design TimeDrop the SplashScreenManager component onto the form. Right click the component in the Visual Studio tray and select Add Splash Screen . The SplashScreenManager adds a new SplashScreen form to your project. Double-click the SplashScreen1.
If you trigger the splash screen to show in the Application.Startup Event you will have full control over it. (be sure to call .Show() with false)
private void Application_Startup(object sender, StartupEventArgs e)
{
SplashScreen screen = new SplashScreen("splashScreen.png");
screen.Show(false);
}
Then you can call screen.Close() when you would like the splash screen to close.
You can also call System.Threading.Thread.Sleep() before the InitializeComponent in the main window. this works.
something like that:
public MainWindow()
{
System.Threading.Thread.Sleep(2000);
InitializeComponent();}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With