📄 form2.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace shebeiguanli
{
/// <summary>
/// Form2 的摘要说明。
/// </summary>
public class Form2 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.RadioButton radioButton3;
private System.Windows.Forms.RadioButton radioButton4;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form2()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton3 = new System.Windows.Forms.RadioButton();
this.radioButton4 = new System.Windows.Forms.RadioButton();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("幼圆", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(40, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 232);
this.label1.TabIndex = 0;
this.label1.Text = "欢迎使用设备管理系统";
//
// radioButton1
//
this.radioButton1.Location = new System.Drawing.Point(120, 64);
this.radioButton1.Name = "radioButton1";
this.radioButton1.TabIndex = 1;
this.radioButton1.Text = "设备信息浏览";
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// radioButton2
//
this.radioButton2.Location = new System.Drawing.Point(120, 104);
this.radioButton2.Name = "radioButton2";
this.radioButton2.TabIndex = 2;
this.radioButton2.Text = "设备管理记录";
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton3
//
this.radioButton3.Location = new System.Drawing.Point(120, 144);
this.radioButton3.Name = "radioButton3";
this.radioButton3.TabIndex = 3;
this.radioButton3.Text = "设备维修记录";
this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged);
//
// radioButton4
//
this.radioButton4.Location = new System.Drawing.Point(120, 184);
this.radioButton4.Name = "radioButton4";
this.radioButton4.TabIndex = 4;
this.radioButton4.Text = "设备维护记录";
this.radioButton4.CheckedChanged += new System.EventHandler(this.radioButton4_CheckedChanged);
//
// button1
//
this.button1.Location = new System.Drawing.Point(280, 160);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 24);
this.button1.TabIndex = 5;
this.button1.Text = "确定";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(280, 216);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 24);
this.button2.TabIndex = 6;
this.button2.Text = "返回";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Form2
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(400, 273);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.radioButton4);
this.Controls.Add(this.radioButton3);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.Name = "Form2";
this.Text = "Form2";
this.ResumeLayout(false);
}
#endregion
public int p;
private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
{
p=1;
}
private void button1_Click(object sender, System.EventArgs e)
{
switch(p)
{
case 1:
Form form6 =new Form6();
form6.ShowDialog();
this.Close();
break;
case 2:
Form form3 =new Form3();
form3.ShowDialog();
this.Close();
break;
case 3:
Form form4 =new Form4();
form4.ShowDialog();
this.Close();
break;
case 4:
Form form7 =new Form7();
form7.ShowDialog();
this.Close();
break;
default:break;
}
}
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
p=2;
}
private void radioButton3_CheckedChanged(object sender, System.EventArgs e)
{
p=3;
}
private void radioButton4_CheckedChanged(object sender, System.EventArgs e)
{
p=4;
}
private void button2_Click(object sender, System.EventArgs e)
{
Form form1 =new Form1();
form1.ShowDialog();
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -