📄 form1.cs
字号:
namespace WindowsApp_Hello
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.WinForms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components;
private System.WinForms.Button button4;
private System.WinForms.Button button3;
private System.WinForms.Button button2;
private System.WinForms.Button button1;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
// this.Text="Hello World!";
}
/// <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.button2 = new System.WinForms.Button ();
this.button3 = new System.WinForms.Button ();
this.button1 = new System.WinForms.Button ();
this.button4 = new System.WinForms.Button ();
//@this.TrayHeight = 0;
//@this.TrayLargeIcon = false;
//@this.TrayAutoArrange = true;
button2.Location = new System.Drawing.Point (32, 96);
button2.Size = new System.Drawing.Size (75, 23);
button2.TabIndex = 1;
button2.Text = "Red";
button3.Visible = false;
button3.Location = new System.Drawing.Point (88, 136);
button3.Size = new System.Drawing.Size (75, 23);
button3.TabIndex = 2;
button3.Text = "Blue";
button1.Location = new System.Drawing.Point (88, 24);
button1.Size = new System.Drawing.Size (96, 40);
button1.TabIndex = 0;
button1.Text = "命令按钮";
button1.Click += new System.EventHandler (this.button1_Click);
button4.Visible = false;
button4.Location = new System.Drawing.Point (168, 176);
button4.Size = new System.Drawing.Size (75, 23);
button4.TabIndex = 3;
button4.Text = "Green";
this.Text = "欢迎新世界!!!";
this.AutoScaleBaseSize = new System.Drawing.Size (6, 14);
this.Click += new System.EventHandler (this.Form1_Click);
this.Controls.Add (this.button4);
this.Controls.Add (this.button3);
this.Controls.Add (this.button2);
this.Controls.Add (this.button1);
}
protected void button1_Click (object sender, System.EventArgs e)
{
this.Text="命令按钮产生网络世界";
}
protected void Form1_Click (object sender, System.EventArgs e)
{
// this.Text="欢迎网络编程世界!!!(C)Copyrighy(2001)";
}
/// <summary>
/// The main entry point for the application.
/// </summary>
public static void Main(string[] args)
{
Form1 aform=new Form1();
Application.Run(new Form1());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -