⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex-13-02

📁 Programming Csharp Source Code(代码) Programming Csharp Source Code
💻
字号:
// Example 13-02: Source code generated by the IDE

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace ProgCSharpWindowsForm
{
    /// <summary>
    /// Summary description for Form1.
    /// </summary>
    public class Form1 : System.Windows.Forms.Form
    {
      private System.Windows.Forms.Label lblOutput;
      private System.Windows.Forms.Button btnCancel;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container 
         components;

        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code 
         // after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();
            if(components != null)
                components.Dispose();
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
         this.lblOutput = new System.Windows.Forms.Label();
         this.btnCancel = new System.Windows.Forms.Button();
         this.SuspendLayout();
         // 
         // lblOutput
         // 
         this.lblOutput.Font = new System.Drawing.Font("Arial", 15.75F, 
            System.Drawing.FontStyle.Bold, 
            System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
         this.lblOutput.Location = new System.Drawing.Point(24, 16);
         this.lblOutput.Name = "lblOutput";
         this.lblOutput.Size = new System.Drawing.Size(136, 48);
         this.lblOutput.TabIndex = 0;
         this.lblOutput.Text = "Hello World";
         // 
         // btnCancel
         // 
         this.btnCancel.Location = new System.Drawing.Point(192, 208);
         this.btnCancel.Name = "btnCancel";
         this.btnCancel.TabIndex = 1;
         this.btnCancel.Text = "Cancel";
         this.btnCancel.Click += new System.EventHandler(
            this.btnCancel_Click);
         // 
         // Form1
         // 
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(292, 273);
         this.Controls.AddRange(new System.Windows.Forms.Control[] {
                   this.btnCancel, this.lblOutput});
         this.Name = "Form1";
         this.Text = "Form1";
         this.ResumeLayout(false);

      }

      private void btnCancel_Click(object sender, System.EventArgs e)
      {
         Application.Exit();
      }

        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main() 
        {
            Application.Run(new Form1());
        }


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -