fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5.  
  6. namespace WindowsFormsApplication1
  7. {
  8. static class Program
  9. {
  10. /// <summary>
  11. /// アプリケーションのメイン エントリ ポイントです。
  12. /// </summary>
  13. [STAThread]
  14. static void Main()
  15. {
  16. Application.EnableVisualStyles();
  17. Application.SetCompatibleTextRenderingDefault(false);
  18. Form[] forms = new Form[3];
  19.  
  20. for (int i = 0; i < forms.Length; ++i)
  21. {
  22. forms[i] = new Form();
  23. forms[i].FormClosed += (sender, e) => {
  24. int count = 0;
  25. foreach (Form f in forms)
  26. {
  27. if (f.Visible == false) count++;
  28. }
  29. if (count == 2)
  30. Application.Exit();
  31. };
  32. forms[i].Show();
  33. }
  34.  
  35. Application.Run();
  36. }
  37. }
  38. }
  39.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty