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

📄 message1.cs

📁 火车订票系统 火车订票系统 火车订票系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Railroad_Trip
{
	/// <summary>
	/// Message1 的摘要说明。
	/// </summary>
	public class Message1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Panel panel1;
		private System.Windows.Forms.Label lblguanbi;
		private System.Windows.Forms.Label lblqueding;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Message1()
		{
			//
			// 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(Message1));
			this.panel1 = new System.Windows.Forms.Panel();
			this.lblqueding = new System.Windows.Forms.Label();
			this.lblguanbi = new System.Windows.Forms.Label();
			this.panel1.SuspendLayout();
			this.SuspendLayout();
			// 
			// panel1
			// 
			this.panel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage")));
			this.panel1.Controls.Add(this.lblqueding);
			this.panel1.Controls.Add(this.lblguanbi);
			this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.panel1.Location = new System.Drawing.Point(0, 0);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(376, 205);
			this.panel1.TabIndex = 0;
			this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove);
			this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseDown);
			// 
			// lblqueding
			// 
			this.lblqueding.BackColor = System.Drawing.Color.Transparent;
			this.lblqueding.Location = new System.Drawing.Point(22, 158);
			this.lblqueding.Name = "lblqueding";
			this.lblqueding.Size = new System.Drawing.Size(334, 16);
			this.lblqueding.TabIndex = 1;
			this.lblqueding.Click += new System.EventHandler(this.lblqueding_Click);
			// 
			// lblguanbi
			// 
			this.lblguanbi.BackColor = System.Drawing.Color.Transparent;
			this.lblguanbi.Location = new System.Drawing.Point(332, 36);
			this.lblguanbi.Name = "lblguanbi";
			this.lblguanbi.Size = new System.Drawing.Size(18, 12);
			this.lblguanbi.TabIndex = 0;
			this.lblguanbi.Click += new System.EventHandler(this.lblguanbi_Click);
			// 
			// Message1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(376, 205);
			this.Controls.Add(this.panel1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
			this.Name = "Message1";
			this.Text = "Message1";
			this.panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void lblguanbi_Click(object sender, System.EventArgs e)
		{
			this.Dispose();
		}

		private void lblqueding_Click(object sender, System.EventArgs e)
		{
		    this.Dispose();
		}

		private bool isclick=false;
		Point oldpoint=new Point(0,0);//界面的初始焦点
		private void panel1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
		
			if(isclick)
			{
				isclick=false;
			}
			else
			{
				isclick=true;
				oldpoint.X=e.X;
				oldpoint.Y=e.Y;
			}
		}

		private void panel1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
		
			if(isclick)
			{
				Point newpoint=new Point(this.Location.X,this.Location.Y);
				newpoint.X=this.Location.X+e.X-oldpoint.X;
				newpoint.Y=this.Location.Y+e.Y-oldpoint.Y;
				this.Location=newpoint;
			}
		}
	}
}

⌨️ 快捷键说明

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