📄 form1.cs
字号:
namespace Ch9_9
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
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();
components.Dispose();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container ();
this.button1 = new System.Windows.Forms.Button ();
this.label1 = new System.Windows.Forms.Label ();
this.label2 = new System.Windows.Forms.Label ();
this.textBox1 = new System.Windows.Forms.TextBox ();
this.label3 = new System.Windows.Forms.Label ();
this.textBox2 = new System.Windows.Forms.TextBox ();
//@this.TrayHeight = 0;
//@this.TrayLargeIcon = false;
//@this.TrayAutoArrange = true;
button1.Location = new System.Drawing.Point (208, 168);
button1.Size = new System.Drawing.Size (75, 23);
button1.TabIndex = 5;
button1.Text = "&Update";
button1.Click += new System.EventHandler (this.button1_Click);
label1.Location = new System.Drawing.Point (32, 24);
label1.Text = "label1";
label1.Size = new System.Drawing.Size (496, 24);
label1.TabIndex = 0;
label2.Location = new System.Drawing.Point (24, 88);
label2.Text = "Text String 1:";
label2.Size = new System.Drawing.Size (100, 16);
label2.TabIndex = 3;
textBox1.Location = new System.Drawing.Point (144, 88);
textBox1.Text = "textBox1";
textBox1.TabIndex = 1;
textBox1.Size = new System.Drawing.Size (320, 20);
label3.Location = new System.Drawing.Point (24, 120);
label3.Text = "Text String 2:";
label3.Size = new System.Drawing.Size (100, 23);
label3.TabIndex = 4;
textBox2.Location = new System.Drawing.Point (144, 120);
textBox2.Text = "textBox2";
textBox2.TabIndex = 2;
textBox2.Size = new System.Drawing.Size (320, 20);
this.Text = "Form1";
this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
this.ClientSize = new System.Drawing.Size (568, 213);
this.Controls.Add (this.button1);
this.Controls.Add (this.label3);
this.Controls.Add (this.label2);
this.Controls.Add (this.textBox2);
this.Controls.Add (this.textBox1);
this.Controls.Add (this.label1);
}
protected void button1_Click (object sender, System.EventArgs e)
{
string s = this.textBox1.Text;
s += " ";
s += this.textBox2.Text;
this.label1.Text = s;
}
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
Application.Run(new Form1());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -