我有一個應用程序與splashscreen。當啓動畫面消失時,窗口會在幾分之一秒內打開最大化,然後我的應用程序返回到背景(如最小化)。爲什麼會發生?我的表單已啓用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
}
[正道(http://stackoverflow.com/a/15836105/1997232)的做閃屏。 [「左」的方式](http://stackoverflow.com/a/32469582/1997232)(你正在使用,因爲它似乎)。 – Sinatr
[加載主窗體時顯示啓動畫面](http://stackoverflow.com/a/32421479/3110834) –