あなたがイントロ フォームと呼んでいるものは、スプラッシュ スクリーンと呼ぶべきです。program.cs では、スプラッシュ スクリーン (ロゴ、タイトル、アプリケーションに関する情報、バージョン番号など) をポップアップ表示するだけです。スプラッシュ スクリーンが一定時間表示されます (これにはタイマーを使用するか、少し重いですが Thread.Sleep も可能です)。
スプラッシュ スクリーンが閉じると、MainForm が表示され、そこから MovieManager をインスタンス化するか、静的な MovieManager を使用できます (用途によって異なります)。メインフォームから、新しいムービー フォームをインスタンス化して表示することができます。
次のようなコードを使用します。
static void Main(string[] args)
{
try
{
SplashScreen.ShowSplashScreen();
Application.DoEvents();
SplashScreen.WaitForVisibility(.5);
bool starting = true;
while (starting)
{
try
{
SplashScreen.SetStatus("Initialize mainform...");
starting = false;
Application.Run(new MainForm());
}
catch (Exception ex)
{
if (starting)
starting = XtraMessageBox.Show(ex.Message, "Fout bij initialiseren", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) == DialogResult.Retry;
else
throw (ex);
}
}
}
catch (Exception ex)
{
if (ex is object)
XtraMessageBox.Show(ex.Message, "Algemene fout", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
}
}
スプラッシュスクリーンのコード (抜粋) は次のようになります。
if (_splashForm == null)
{
ThreadPool.QueueUserWorkItem(RunSplashForm, null);
while (_splashForm == null || _splashForm.IsHandleCreated == false)
{
System.Threading.Thread.Sleep(50);
}
}
おそらく、これらのリンクからも役立つ情報が得られます。
http://www.reflectionit.nl/Articles/Splash.aspx
そして、これを独自のコードの基礎として使用しました。
http://www.codeproject.com/Articles/5454/A-Pretty-Good-Splash-Screen-in-C