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

📄 stat_of_protrace.cs

📁 软件工程的课程作业
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace PSMS
{
	/// <summary>
	/// Summary description for stat_of_protrace.
	/// </summary>
	public class stat_of_protrace : System.Windows.Forms.Form
	{
		public System.Windows.Forms.TextBox starttime;
		public System.Windows.Forms.TextBox endtime;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		public System.Windows.Forms.Button submit;
		private System.Windows.Forms.Button cancel;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public stat_of_protrace()
		{
			//
			// 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(stat_of_protrace));
			this.starttime = new System.Windows.Forms.TextBox();
			this.endtime = new System.Windows.Forms.TextBox();
			this.submit = new System.Windows.Forms.Button();
			this.cancel = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// starttime
			// 
			this.starttime.Location = new System.Drawing.Point(128, 24);
			this.starttime.Name = "starttime";
			this.starttime.Size = new System.Drawing.Size(128, 21);
			this.starttime.TabIndex = 0;
			this.starttime.Text = "";
			// 
			// endtime
			// 
			this.endtime.Location = new System.Drawing.Point(128, 64);
			this.endtime.Name = "endtime";
			this.endtime.Size = new System.Drawing.Size(128, 21);
			this.endtime.TabIndex = 1;
			this.endtime.Text = "";
			// 
			// submit
			// 
			this.submit.Location = new System.Drawing.Point(48, 112);
			this.submit.Name = "submit";
			this.submit.TabIndex = 2;
			this.submit.Text = "确定";
			this.submit.Click += new System.EventHandler(this.submit_Click);
			// 
			// cancel
			// 
			this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.cancel.Location = new System.Drawing.Point(160, 112);
			this.cancel.Name = "cancel";
			this.cancel.TabIndex = 3;
			this.cancel.Text = "取消";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 24);
			this.label1.Name = "label1";
			this.label1.TabIndex = 4;
			this.label1.Text = "统计开始日期:";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 64);
			this.label2.Name = "label2";
			this.label2.TabIndex = 5;
			this.label2.Text = "统计结束日期:";
			// 
			// stat_of_protrace
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.AliceBlue;
			this.CancelButton = this.cancel;
			this.ClientSize = new System.Drawing.Size(280, 150);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.cancel);
			this.Controls.Add(this.submit);
			this.Controls.Add(this.endtime);
			this.Controls.Add(this.starttime);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MaximumSize = new System.Drawing.Size(288, 184);
			this.MinimumSize = new System.Drawing.Size(288, 184);
			this.Name = "stat_of_protrace";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "stat_of_protrace";
			this.ResumeLayout(false);

		}
		#endregion

		private void submit_Click(object sender, System.EventArgs e)
		{
			if(starttime.Text == "" || endtime.Text == "")
				MessageBox.Show("Please Input Starttime and Endtime!");
			else 
			{
				try
				{
					DateTime.Parse(starttime.Text);
					DateTime.Parse(endtime.Text);
				}
				catch(System.Exception ie)
				{
					MessageBox.Show(""+ie.Message);
					return;
				}
				submit.BackColor = Color.GreenYellow;
				Close();
			}
		}
	}
}

⌨️ 快捷键说明

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