Search code examples
c#wpfwindowssplash-screen

Activate window/application


I have implemented a Splash Screen according to WiredPrairie unmanaged c++ splasher class.

But not when my application loads, my window isn't activated. The user has to click on the login box even thought it is the only window open in my application.

I have tried the following but none of these work.

Topmost = true;
Focus();
Activate();

Is there any way to give my login window focus when the application starts? Sometimes the window behind it has focus! (Visual Studio if run on my machine), Explorer or a different application window on other peoples machines.

Anyone have any idea?


Solution

  • Where did you try Activate()?

    I found that using it in the window's constructor did not help, but calling it when the Load event occured did activate it.

    I have had this problem in a different scenario, though...