BaseForm.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace DayOf1440.UI
  8. {
  9. /// <summary>
  10. /// Form 基类
  11. /// </summary>
  12. public partial class BaseForm : Form
  13. {
  14. public BaseForm()
  15. {
  16. this.Load += new EventHandler(BaseForm_Load);
  17. this.FormClosed += new FormClosedEventHandler(BaseForm_FormClosed);
  18. InitializeComponent();
  19. }
  20. public void BaseForm_Load(object sender, EventArgs e)
  21. {
  22. Program.formList.Add(this);
  23. }
  24. public void BaseForm_FormClosed(object sender, FormClosedEventArgs e)
  25. {
  26. Program.formList.Remove(this);
  27. }
  28. private void InitializeComponent()
  29. {
  30. this.SuspendLayout();
  31. //
  32. // BaseForm
  33. //
  34. this.ClientSize = new System.Drawing.Size(1350, 729);
  35. this.Name = "BaseForm";
  36. this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  37. this.DoubleClick += new System.EventHandler(this.BaseForm_DoubleClick);
  38. this.ResumeLayout(false);
  39. }
  40. private void BaseForm_DoubleClick(object sender, EventArgs e)
  41. {
  42. Application.Exit();
  43. }
  44. }
  45. }