啟動界面管理器序列化細節
SplashScreenManager 組件的序列化取決于所選的Active Splash Form(SplashScreenManager.ActiveSplashFormTypeInfo屬性)。

激活啟動表單是Splash Screen或None
SplashScreenManager類的實例在主表單的InitializeComponent方法中聲明為局部變量,這種序列化方法可確保在所有其他組件之前初始化啟動界面管理器,并在您的表單開始的第一刻啟動選定的啟動界面。 但是請注意,您將無法處理在InitializeComponent方法中聲明SplashScreenManager組件的本地實例。
這里是在這種情況下可以使用的方法。
- 若要手動打開和關閉啟動表單,請使用SplashScreenManager類提供的靜態方法。
- 要與當前顯示的初始表單交互,請使用SplashScreenManager.Default對象提供的非靜態方法。
C#:
// Display a Wait Form SplashScreenManager.ShowForm(typeof(WaitForm2)); //... //Change its caption SplashScreenManager.Default.SetWaitFormCaption("new caption"); //... //Close the Wait Form SplashScreenManager.CloseForm();
VB.NET:
' Display a Wait Form SplashScreenManager.ShowForm(GetType(WaitForm2)) '... 'Change its caption SplashScreenManager.Default.SetWaitFormCaption("new caption") '... 'Close the Wait Form SplashScreenManager.CloseForm()
激活啟動表單是一個等待表單
SplashScreenManager類的實例被聲明為表單的局部變量,而不是InitializeComponent方法。 在這種情況下,您可以使用SplashScreenManager的非靜態方法(可通過SplashScreenManager實例訪問)打開,關閉所選的等待表單并與之交互。 這些方法是:SplashScreenManager.ShowWaitForm, SplashScreenManager.CloseWaitForm, SplashScreenManager.SetWaitFormCaption, SplashScreenManager.SetWaitFormDescription and SplashScreenManager.SendCommand。