Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6651955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:04:23+00:00 2026-05-26T01:04:23+00:00

When the SplashScreen closes (either manually or by AutoClose), it steals the focus of

  • 0

When the SplashScreen closes (either manually or by AutoClose), it steals the focus of the MainWindow during the fade-out animation. This results in the caption of the main window switching from active to inactive (grey) to active. Is there any trick to keep the SplashScreen from stealing focus?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:04:24+00:00Added an answer on May 26, 2026 at 1:04 am

    Tell the SplashScreen that MainWindow is its parent window. When a child window loses focus, its parent gets the focus. If there is no parent, the window manager decides.

    splashScreen.Show(mainWindow);

    EDIT:

    I just found out that there’s a SplashScreen class. Looks like you use that class and not just a normal Form as I assumed.

    So, I just made a simple WPF app with a SplashScreen and for me the mentioned effect didn’t happen. The main window didn’t lose focus.

    I would suggest you to comment potions of your app’s initalization code out until the flashing stops. Then you have a starting point for more research why the focus is lost.

    EDIT2:

    Without knowing your code I tried to reproduce the phenomenon and it wasn’t too hard. Whatever I tried, the focus change always happened when the main window was already shown and had focus.

    So the best solution I see is to manually show the main window after calling the splash screen’s Close() method:

    1. Remove the StartupUri from App.xaml

    2. Show the SplashScreen after starting the app and initializing ressources. After a (currently fixed) delay close the SplashScreen and show the main window:


    public partial class App : Application
    {
        const int FADEOUT_DELAY = 2000;
    
        SplashScreen splash = new SplashScreen("splash.jpg");
    
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            splash.Show(false, true);
    
            var worker = new BackgroundWorker();
            worker.DoWork += (sender, ea) =>
                {
                    Thread.Sleep(1000);
                    splash.Close(new TimeSpan(0, 0, 0, 0, FADEOUT_DELAY));
                    // you could reduce the delay and show the main window with a nice transition
                    Thread.Sleep(FADEOUT_DELAY); 
                    Dispatcher.BeginInvoke(new Action(() => MainWindow.Show()));
                };
    
            worker.RunWorkerAsync();
    
            MainWindow = new MainWindow();
    
            // do more initialization
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Splashscreen/Loading-Window in my WPF application is set to Topmost=True . Now this windows
The resource editor keeps wiping out code of this form in my .rc: #ifndef
I was wondering if I can set the splash screen to a programmatic SplashScreen
I have a problem and that is my SplashScreen I have. It is built
I looked at other questions regarding this problem and tried their solutions, but it
i have this code: private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { this.WindowState = FormWindowState.Minimized;
So I've been working on a soundboard app for my kids. This is my
This question seems to have been asked many times in many different forms but
My application fetches data from a live feed, processes it and displays the results.
I have an application which uses a SQL database. This is encapsulated by a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.