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

C#编程

开发平台:

Others

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. namespace CustomActionApp
  8. {
  9. /// <summary>
  10. /// Summary description for Form1.
  11. /// </summary>
  12. public class Form1 : System.Windows.Forms.Form
  13. {
  14.     private System.Windows.Forms.Label label1;
  15.     private System.Windows.Forms.Button button1;
  16. /// <summary>
  17. /// Required designer variable.
  18. /// </summary>
  19. private System.ComponentModel.Container components = null;
  20. public Form1()
  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.label1 = new System.Windows.Forms.Label();
  52.       this.button1 = new System.Windows.Forms.Button();
  53.       this.SuspendLayout();
  54.       // 
  55.       // label1
  56.       // 
  57.       this.label1.Location = new System.Drawing.Point(56, 40);
  58.       this.label1.Name = "label1";
  59.       this.label1.Size = new System.Drawing.Size(168, 48);
  60.       this.label1.TabIndex = 0;
  61.       this.label1.Text = "This would be a custom action. Click OK to exit!";
  62.       this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  63.       // 
  64.       // button1
  65.       // 
  66.       this.button1.Location = new System.Drawing.Point(96, 120);
  67.       this.button1.Name = "button1";
  68.       this.button1.TabIndex = 1;
  69.       this.button1.Text = "OK";
  70.       this.button1.Click += new System.EventHandler(this.button1_Click);
  71.       // 
  72.       // Form1
  73.       // 
  74.       this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  75.       this.ClientSize = new System.Drawing.Size(288, 213);
  76.       this.Controls.Add(this.button1);
  77.       this.Controls.Add(this.label1);
  78.       this.Name = "Form1";
  79.       this.Text = "Custom Action";
  80.       this.ResumeLayout(false);
  81.     }
  82. #endregion
  83. /// <summary>
  84. /// The main entry point for the application.
  85. /// </summary>
  86. [STAThread]
  87. static void Main() 
  88. {
  89. Application.Run(new Form1());
  90. }
  91.     private void button1_Click(object sender, System.EventArgs e)
  92.     {
  93.       this.Close();
  94.     }
  95. }
  96. }