最終フォームを閉じるときにスタートアップ フォームを表示するにFormClosed
は、最終フォームのイベントのイベント ハンドラーを次のように追加します。
FinalForm f = new FinalForm();
f.FormClosed += (s,e) => {
StartupForm sf = new StartupForm();
sf.Show;
//if your StartupForm is defined somewhere
//just call sf.Show();
};
//If you are using VS 2005 or below, you have to define a method for FormClosed event handler (unable to use the lambda expression above
private void FormClosedHandler(object sender, FormClosedEventArgs e){
StartupForm sf = new StartupForm();
sf.Show;
//if your StartupForm is defined somewhere
//just call sf.Show();
}
//Register the FormClosed event with the event handler above
f.FormClosed += new FormClosedEventHandler(FormClosedHandler);
//show your final form
f.Show();
//if this form is closed, the event FormClosed will be raised and the corresponding event handler (we added above) will be called.