fork download
  1. static class Program {
  2. /// <summary>
  3. /// アプリケーションのメイン エントリ ポイントです。
  4. /// </summary>
  5. [STAThread]
  6. static void Main() {
  7. //Application.EnableVisualStyles();
  8. //Application.SetCompatibleTextRenderingDefault(false);
  9. //Application.Run(new Form1());
  10.  
  11. Form form = new Form1();
  12.  
  13. form.Text = "艦隊これくしょん";
  14. Application.Run(form);
  15. }
  16. }
  17.  
  18. class Form1 : Form {
  19.  
  20. public Form1() {
  21. Bitmap bitmap = new Bitmap(@"C:\Desktop\プログラミング\sanpuru.jpg");
  22.  
  23. this.BackgroundImage = bitmap;
  24. this.BackgroundImageLayout = ImageLayout.Zoom;
  25. this.FormClosing += new FormClosingEventHandler(Form1_FormClosing);
  26. }
  27.  
  28. void Form1_FormClosing(object sender, FormClosingEventArgs e) {
  29.  
  30. DialogResult result = MessageBox.Show("終了しますか?", "確認", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  31. if (result == System.Windows.Forms.DialogResult.No) {
  32. e.Cancel = true;
  33. }
  34.  
  35. }
  36.  
  37. }
  38.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(18,23): error CS0246: The type or namespace name `Form' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(28,55): error CS0246: The type or namespace name `FormClosingEventArgs' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty