ChildForm.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:2k
源码类别:

C#编程

开发平台:

Others

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. namespace SimpleMDIApp
  7. {
  8. /// <summary>
  9. /// Summary description for ChildForm.
  10. /// </summary>
  11. public class ChildForm : System.Windows.Forms.Form
  12. {
  13.     private System.Windows.Forms.MainMenu mainMenu1;
  14.     private System.Windows.Forms.MenuItem mnuChildClose;
  15. private System.Windows.Forms.MenuItem menuChild;
  16. /// <summary>
  17. /// Required designer variable.
  18. /// </summary>
  19. private System.ComponentModel.Container components = null;
  20. public ChildForm()
  21. {
  22. //
  23. // Required for Windows Form Designer support
  24. //
  25. InitializeComponent();
  26. //
  27. // TODO: Add any constructor code after InitializeComponent call
  28. //
  29. }
  30. /// <summary>
  31. /// Clean up any resources being used.
  32. /// </summary>
  33. protected override void Dispose( bool disposing )
  34. {
  35. if( disposing )
  36. {
  37. if(components != null)
  38. {
  39. components.Dispose();
  40. }
  41. }
  42. base.Dispose( disposing );
  43. }
  44. #region Windows Form Designer generated code
  45. /// <summary>
  46. /// Required method for Designer support - do not modify
  47. /// the contents of this method with the code editor.
  48. /// </summary>
  49. private void InitializeComponent()
  50. {
  51. this.mainMenu1 = new System.Windows.Forms.MainMenu();
  52. this.menuChild = new System.Windows.Forms.MenuItem();
  53. this.mnuChildClose = new System.Windows.Forms.MenuItem();
  54. // 
  55. // mainMenu1
  56. // 
  57. this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  58.   this.menuChild});
  59. // 
  60. // menuChild
  61. // 
  62. this.menuChild.Index = 0;
  63. this.menuChild.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
  64.   this.mnuChildClose});
  65. this.menuChild.MergeType = System.Windows.Forms.MenuMerge.MergeItems;
  66. this.menuChild.Text = "Child";
  67. // 
  68. // mnuChildClose
  69. // 
  70. this.mnuChildClose.Index = 0;
  71. this.mnuChildClose.Text = "Close";
  72. this.mnuChildClose.Click += new System.EventHandler(this.mnuChildClose_Click);
  73. // 
  74. // ChildForm
  75. // 
  76. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  77. this.ClientSize = new System.Drawing.Size(292, 271);
  78. this.Menu = this.mainMenu1;
  79. this.Name = "ChildForm";
  80. this.Text = "ChildForm";
  81. }
  82. #endregion
  83.     private void mnuChildClose_Click(object sender, System.EventArgs e)
  84.     {
  85.       this.Close();
  86.     }
  87. }
  88. }