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

📄 form1.cs

📁 《c#技术内幕代码》
💻 CS
字号:
namespace Ch9_4
{
    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.RadioButton radioButton7;
		private System.Windows.Forms.RadioButton radioButton6;
		private System.Windows.Forms.RadioButton radioButton5;
		private System.Windows.Forms.RadioButton radioButton4;
		private System.Windows.Forms.RadioButton radioButton3;
		private System.Windows.Forms.RadioButton radioButton2;
		private System.Windows.Forms.RadioButton radioButton1;

        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.radioButton1 = new System.Windows.Forms.RadioButton ();
			this.radioButton6 = new System.Windows.Forms.RadioButton ();
			this.radioButton2 = new System.Windows.Forms.RadioButton ();
			this.radioButton7 = new System.Windows.Forms.RadioButton ();
			this.button1 = new System.Windows.Forms.Button ();
			this.radioButton3 = new System.Windows.Forms.RadioButton ();
			this.radioButton4 = new System.Windows.Forms.RadioButton ();
			this.radioButton5 = new System.Windows.Forms.RadioButton ();
			//@this.TrayHeight = 0;
			//@this.TrayLargeIcon = false;
			//@this.TrayAutoArrange = true;
			radioButton1.Location = new System.Drawing.Point (16, 16);
			radioButton1.Text = "No Border";
			radioButton1.Size = new System.Drawing.Size (100, 23);
			radioButton1.TabIndex = 0;
			radioButton1.CheckedChanged += new System.EventHandler (this.radioButton1_CheckedChanged);
			radioButton6.Location = new System.Drawing.Point (16, 144);
			radioButton6.Text = "Sizeable";
			radioButton6.Size = new System.Drawing.Size (100, 23);
			radioButton6.TabIndex = 5;
			radioButton6.CheckedChanged += new System.EventHandler (this.radioButton6_CheckedChanged);
			radioButton2.Location = new System.Drawing.Point (16, 40);
			radioButton2.Text = "Fixed 3D";
			radioButton2.Size = new System.Drawing.Size (100, 23);
			radioButton2.TabIndex = 1;
			radioButton2.CheckedChanged += new System.EventHandler (this.radioButton2_CheckedChanged);
			radioButton7.Location = new System.Drawing.Point (16, 168);
			radioButton7.Text = "Sizeable Tool Window";
			radioButton7.Size = new System.Drawing.Size (136, 16);
			radioButton7.TabIndex = 6;
			radioButton7.CheckedChanged += new System.EventHandler (this.radioButton7_CheckedChanged);
			button1.Location = new System.Drawing.Point (104, 208);
			button1.Size = new System.Drawing.Size (75, 23);
			button1.TabIndex = 7;
			button1.Text = "&Close";
			button1.Click += new System.EventHandler (this.button1_Click);
			radioButton3.Location = new System.Drawing.Point (16, 64);
			radioButton3.Text = "Fixed Dialog";
			radioButton3.Size = new System.Drawing.Size (100, 23);
			radioButton3.TabIndex = 2;
			radioButton3.CheckedChanged += new System.EventHandler (this.radioButton3_CheckedChanged);
			radioButton4.Location = new System.Drawing.Point (16, 96);
			radioButton4.Text = "Fixed Single";
			radioButton4.Size = new System.Drawing.Size (100, 23);
			radioButton4.TabIndex = 3;
			radioButton4.CheckedChanged += new System.EventHandler (this.radioButton4_CheckedChanged);
			radioButton5.Location = new System.Drawing.Point (16, 120);
			radioButton5.Text = "Fixed Tool Window";
			radioButton5.Size = new System.Drawing.Size (128, 23);
			radioButton5.TabIndex = 4;
			radioButton5.CheckedChanged += new System.EventHandler (this.radioButton5_CheckedChanged);
			this.Text = "Form1";
			this.AutoScaleBaseSize = new System.Drawing.Size (5, 13);
			this.Controls.Add (this.button1);
			this.Controls.Add (this.radioButton7);
			this.Controls.Add (this.radioButton6);
			this.Controls.Add (this.radioButton5);
			this.Controls.Add (this.radioButton4);
			this.Controls.Add (this.radioButton3);
			this.Controls.Add (this.radioButton2);
			this.Controls.Add (this.radioButton1);
		}

		protected void button1_Click (object sender, System.EventArgs e)
		{
             Close();
		}
		protected void radioButton7_CheckedChanged (object sender, System.EventArgs e)
		{
             this.BorderStyle = FormBorderStyle.SizableToolWindow;
		}

		protected void radioButton6_CheckedChanged (object sender, System.EventArgs e)
		{
             this.BorderStyle = FormBorderStyle.Sizable;
		}

		protected void radioButton5_CheckedChanged (object sender, System.EventArgs e)
		{
             this.BorderStyle = FormBorderStyle.FixedToolWindow;
		}

		protected void radioButton4_CheckedChanged (object sender, System.EventArgs e)
		{
            this.BorderStyle = FormBorderStyle.FixedSingle;
		}

		protected void radioButton3_CheckedChanged (object sender, System.EventArgs e)
		{
            this.BorderStyle = FormBorderStyle.FixedDialog;
		}

		protected void radioButton2_CheckedChanged (object sender, System.EventArgs e)
		{
            this.BorderStyle = FormBorderStyle.Fixed3D;
		}

		protected void radioButton1_CheckedChanged (object sender, System.EventArgs e)
		{
            this.BorderStyle = FormBorderStyle.None;
		}

        /// <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 + -