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

📄 form1.cs

📁 主要用C#写的代码
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;

namespace FromZhuJieMian
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label lbl1;
		private System.Windows.Forms.Label lbl2;
		private System.Windows.Forms.Label lbl3;
		private System.Windows.Forms.Label lbl4;
		private System.Windows.Forms.Label lbl5;
		private System.Windows.Forms.Label lbl6;
		private System.Windows.Forms.Label lbl7;
		private System.Windows.Forms.Button bntNext;
		private System.Windows.Forms.PictureBox picTu;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Form1()
		{
			//
			// 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()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
			this.lbl1 = new System.Windows.Forms.Label();
			this.lbl2 = new System.Windows.Forms.Label();
			this.lbl3 = new System.Windows.Forms.Label();
			this.lbl4 = new System.Windows.Forms.Label();
			this.lbl5 = new System.Windows.Forms.Label();
			this.lbl6 = new System.Windows.Forms.Label();
			this.lbl7 = new System.Windows.Forms.Label();
			this.bntNext = new System.Windows.Forms.Button();
			this.picTu = new System.Windows.Forms.PictureBox();
			this.SuspendLayout();
			// 
			// lbl1
			// 
			this.lbl1.BackColor = System.Drawing.Color.Transparent;
			this.lbl1.Font = new System.Drawing.Font("隶书", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lbl1.ForeColor = System.Drawing.Color.Red;
			this.lbl1.Location = new System.Drawing.Point(184, 24);
			this.lbl1.Name = "lbl1";
			this.lbl1.Size = new System.Drawing.Size(384, 48);
			this.lbl1.TabIndex = 0;
			this.lbl1.Text = "欢迎来到网上订票系统";
			// 
			// lbl2
			// 
			this.lbl2.BackColor = System.Drawing.Color.Transparent;
			this.lbl2.Font = new System.Drawing.Font("楷体_GB2312", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lbl2.ForeColor = System.Drawing.Color.Red;
			this.lbl2.Location = new System.Drawing.Point(232, 80);
			this.lbl2.Name = "lbl2";
			this.lbl2.Size = new System.Drawing.Size(272, 32);
			this.lbl2.TabIndex = 1;
			this.lbl2.Text = "请认真阅读提示,在进行操作";
			// 
			// lbl3
			// 
			this.lbl3.BackColor = System.Drawing.Color.Transparent;
			this.lbl3.Location = new System.Drawing.Point(112, 152);
			this.lbl3.Name = "lbl3";
			this.lbl3.Size = new System.Drawing.Size(568, 16);
			this.lbl3.TabIndex = 2;
			this.lbl3.Text = "1:具备网上银行的客户才可以操作该系统。";
			// 
			// lbl4
			// 
			this.lbl4.BackColor = System.Drawing.Color.Transparent;
			this.lbl4.Location = new System.Drawing.Point(112, 184);
			this.lbl4.Name = "lbl4";
			this.lbl4.Size = new System.Drawing.Size(568, 16);
			this.lbl4.TabIndex = 3;
			this.lbl4.Text = "2:该系统一但订票成功,不办理退票业务。请选择好车次。";
			// 
			// lbl5
			// 
			this.lbl5.BackColor = System.Drawing.Color.Transparent;
			this.lbl5.Location = new System.Drawing.Point(112, 224);
			this.lbl5.Name = "lbl5";
			this.lbl5.Size = new System.Drawing.Size(568, 16);
			this.lbl5.TabIndex = 4;
			this.lbl5.Text = "3:为了你的财产不受侵害。在进行网上交易时,请妥善保护好你的卡号密码!";
			// 
			// lbl6
			// 
			this.lbl6.BackColor = System.Drawing.Color.Transparent;
			this.lbl6.Location = new System.Drawing.Point(112, 256);
			this.lbl6.Name = "lbl6";
			this.lbl6.Size = new System.Drawing.Size(568, 16);
			this.lbl6.TabIndex = 5;
			this.lbl6.Text = "4:请自觉爱护公共设施。争作文明人。";
			// 
			// lbl7
			// 
			this.lbl7.BackColor = System.Drawing.Color.Transparent;
			this.lbl7.Font = new System.Drawing.Font("隶书", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.lbl7.ForeColor = System.Drawing.Color.Red;
			this.lbl7.Location = new System.Drawing.Point(128, 296);
			this.lbl7.Name = "lbl7";
			this.lbl7.Size = new System.Drawing.Size(440, 48);
			this.lbl7.TabIndex = 6;
			this.lbl7.Text = "进入系统请你按提示进行操作!单击下一步进入......";
			// 
			// bntNext
			// 
			this.bntNext.BackColor = System.Drawing.SystemColors.ActiveCaption;
			this.bntNext.Font = new System.Drawing.Font("楷体_GB2312", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.bntNext.ForeColor = System.Drawing.Color.Red;
			this.bntNext.Location = new System.Drawing.Point(280, 472);
			this.bntNext.Name = "bntNext";
			this.bntNext.Size = new System.Drawing.Size(176, 64);
			this.bntNext.TabIndex = 7;
			this.bntNext.Text = "下一步";
			this.bntNext.Click += new System.EventHandler(this.bntNext_Click);
			// 
			// picTu
			// 
			this.picTu.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("picTu.BackgroundImage")));
			this.picTu.Location = new System.Drawing.Point(600, 432);
			this.picTu.Name = "picTu";
			this.picTu.Size = new System.Drawing.Size(136, 160);
			this.picTu.TabIndex = 8;
			this.picTu.TabStop = false;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.Control;
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(744, 598);
			this.Controls.Add(this.picTu);
			this.Controls.Add(this.bntNext);
			this.Controls.Add(this.lbl7);
			this.Controls.Add(this.lbl6);
			this.Controls.Add(this.lbl5);
			this.Controls.Add(this.lbl4);
			this.Controls.Add(this.lbl3);
			this.Controls.Add(this.lbl2);
			this.Controls.Add(this.lbl1);
			this.Name = "Form1";
			this.Text = "欢迎进入网上订购火车票系统";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}
        /// <summary>
        /// 下一步单击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
		private void bntNext_Click(object sender, System.EventArgs e)
		{
			//隐藏当前主页
			this.Hide();

			this.Visible=false;
			//显示查询列车窗体
			Form2 f=new Form2();
			f.Show();
			
			
		}

		private void Form1_Load(object sender, System.EventArgs e)
		{
			Thread th=new Thread(new ThreadStart(DisPaly));
			th.Start();
		}
		//创建构造方法
		public void DisPaly()
		{
			for(int i=1;i<=1000;i++)
			{
				Random ran=new Random();
				//定义两个坐标
				int x=0;
				int y=0;
				x=ran.Next(300);
				y=ran.Next(340);
				picTu.Left=x;
				picTu.Top=y;
				Thread.Sleep(1000);
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -