📄 mainform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace Car_Inventory_Control
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnCar;
private System.Windows.Forms.Button btnGenRevenue;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button btnSellCar;
private FileStream fsMaster, fsSale;
private System.Windows.Forms.GroupBox groupBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public MainForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
this.btnCar = new System.Windows.Forms.Button();
this.btnSellCar = new System.Windows.Forms.Button();
this.btnGenRevenue = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// btnCar
//
this.btnCar.Location = new System.Drawing.Point(29, 34);
this.btnCar.Name = "btnCar";
this.btnCar.Size = new System.Drawing.Size(90, 25);
this.btnCar.TabIndex = 0;
this.btnCar.Text = "添加汽车(&A)";
this.btnCar.Click += new System.EventHandler(this.btnCar_Click);
//
// btnSellCar
//
this.btnSellCar.Location = new System.Drawing.Point(29, 103);
this.btnSellCar.Name = "btnSellCar";
this.btnSellCar.Size = new System.Drawing.Size(90, 25);
this.btnSellCar.TabIndex = 1;
this.btnSellCar.Text = "销售汽车(&S)";
this.btnSellCar.Click += new System.EventHandler(this.btnSellCar_Click);
//
// btnGenRevenue
//
this.btnGenRevenue.Location = new System.Drawing.Point(29, 181);
this.btnGenRevenue.Name = "btnGenRevenue";
this.btnGenRevenue.Size = new System.Drawing.Size(90, 43);
this.btnGenRevenue.TabIndex = 2;
this.btnGenRevenue.Text = "生成的收益(R)";
this.btnGenRevenue.Click += new System.EventHandler(this.btnGenRevenue_Click);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(154, 34);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(268, 190);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(10, 17);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(124, 224);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(460, 246);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.btnGenRevenue);
this.Controls.Add(this.btnSellCar);
this.Controls.Add(this.btnCar);
this.Controls.Add(this.groupBox1);
this.Name = "MainForm";
this.Text = "汽车库存窗体";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new MainForm());
}
private void btnCar_Click(object sender, System.EventArgs e)
{
frmAddcar objAddCar = new frmAddcar();
objAddCar.ShowDialog();
}
private void btnSellCar_Click(object sender, System.EventArgs e)
{
frmSellcar objSellCar = new frmSellcar();
objSellCar.ShowDialog();
}
private void btnGenRevenue_Click(object sender, System.EventArgs e)
{
frmGenerateRevenue objGenRev = new frmGenerateRevenue();
objGenRev.ShowDialog();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -