【发布时间】:2016-09-06 12:33:58
【问题描述】:
我有一个带有闪屏的应用程序。当闪屏消失时,窗口会在几分之一秒内打开最大化,然后我的应用程序会回到后台(就像它被最小化一样)。为什么会这样?我的表单启用了WindowState = Maximized。
public Main()
{
//Splashscreen and new window
initializeWindow();
}
public void SplashScreen()
{
Application.Run(new SplashScreen());
}
private void initializeWindow()
{
//Start new Thread which shows Splash Screen
Thread t = new Thread(new ThreadStart(SplashScreen));
t.Start();
//Wait 3 seconds
Thread.Sleep(3000);
InitializeComponent();
//Initialize form
t.Abort();
//Abort and make main form the top form
//TopMost = true; <-- I commented this because it makes other applications not open unless if I minimize the window
}
【问题讨论】:
-
Right way 做启动画面。 "Left" way(您正在使用的那个)。