www.pudn.com > MainPrj_CarShop.rar > frmMdiAbout.cs


using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Reflection; 
using System.Threading; 
using System.Windows.Forms; 
 
namespace MainPrj_CarShop 
{ 
	///  
	/// frmMdiAbout 的摘要说明。 
	///  
	public class frmMdiAbout : System.Windows.Forms.Form 
	{ 
		private System.Windows.Forms.PictureBox picIcon; 
		private System.Windows.Forms.Label lblTitle; 
		private System.Windows.Forms.Label lblVersion; 
		private System.Windows.Forms.Panel panel1; 
		private System.Windows.Forms.TextBox txtMembers; 
		private System.Windows.Forms.Timer timerShow; 
		private System.Windows.Forms.Timer timer1; 
		private System.ComponentModel.IContainer components; 
 
		public frmMdiAbout() 
		{ 
			// 
			// Windows 窗体设计器支持所必需的 
			// 
			InitializeComponent(); 
 
			// 
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码 
			// 
		} 
 
		///  
		/// 清理所有正在使用的资源。 
		///  
		protected override void Dispose( bool disposing ) 
		{ 
			if( disposing ) 
			{ 
				if(components != null) 
				{ 
					components.Dispose(); 
				} 
			} 
			base.Dispose( disposing ); 
		} 
 
		#region Windows 窗体设计器生成的代码 
		///  
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
		/// 此方法的内容。 
		///  
		private void InitializeComponent() 
		{ 
			this.components = new System.ComponentModel.Container(); 
			this.picIcon = new System.Windows.Forms.PictureBox(); 
			this.lblTitle = new System.Windows.Forms.Label(); 
			this.lblVersion = new System.Windows.Forms.Label(); 
			this.panel1 = new System.Windows.Forms.Panel(); 
			this.txtMembers = new System.Windows.Forms.TextBox(); 
			this.timerShow = new System.Windows.Forms.Timer(this.components); 
			this.timer1 = new System.Windows.Forms.Timer(this.components); 
			this.panel1.SuspendLayout(); 
			this.SuspendLayout(); 
			//  
			// picIcon 
			//  
			this.picIcon.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 
			this.picIcon.Location = new System.Drawing.Point(8, 16); 
			this.picIcon.Name = "picIcon"; 
			this.picIcon.Size = new System.Drawing.Size(88, 64); 
			this.picIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; 
			this.picIcon.TabIndex = 0; 
			this.picIcon.TabStop = false; 
			//  
			// lblTitle 
			//  
			this.lblTitle.BackColor = System.Drawing.Color.Transparent; 
			this.lblTitle.Font = new System.Drawing.Font("隶书", 15F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); 
			this.lblTitle.Location = new System.Drawing.Point(104, 16); 
			this.lblTitle.Name = "lblTitle"; 
			this.lblTitle.Size = new System.Drawing.Size(400, 48); 
			this.lblTitle.TabIndex = 1; 
			this.lblTitle.Text = "标题"; 
			this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 
			//  
			// lblVersion 
			//  
			this.lblVersion.BackColor = System.Drawing.Color.Transparent; 
			this.lblVersion.Font = new System.Drawing.Font("华文行楷", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); 
			this.lblVersion.ForeColor = System.Drawing.Color.SteelBlue; 
			this.lblVersion.Location = new System.Drawing.Point(344, 56); 
			this.lblVersion.Name = "lblVersion"; 
			this.lblVersion.Size = new System.Drawing.Size(160, 24); 
			this.lblVersion.TabIndex = 3; 
			this.lblVersion.Text = "版本"; 
			this.lblVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 
			//  
			// panel1 
			//  
			this.panel1.BackColor = System.Drawing.Color.LightGoldenrodYellow; 
			this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; 
			this.panel1.Controls.Add(this.txtMembers); 
			this.panel1.Location = new System.Drawing.Point(8, 88); 
			this.panel1.Name = "panel1"; 
			this.panel1.Size = new System.Drawing.Size(496, 192); 
			this.panel1.TabIndex = 4; 
			//  
			// txtMembers 
			//  
			this.txtMembers.BackColor = System.Drawing.Color.LightGoldenrodYellow; 
			this.txtMembers.BorderStyle = System.Windows.Forms.BorderStyle.None; 
			this.txtMembers.Font = new System.Drawing.Font("隶书", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); 
			this.txtMembers.ForeColor = System.Drawing.Color.Black; 
			this.txtMembers.Location = new System.Drawing.Point(0, 0); 
			this.txtMembers.Multiline = true; 
			this.txtMembers.Name = "txtMembers"; 
			this.txtMembers.ReadOnly = true; 
			this.txtMembers.Size = new System.Drawing.Size(496, 192); 
			this.txtMembers.TabIndex = 6; 
			this.txtMembers.TabStop = false; 
			this.txtMembers.Text = "\r\n组长:叶陈峰\r\n基本资料模块:叶陈峰、蔡振明\r\n销售模块:张逢君、黄寿生\r\n采购模块:林承钰、成益林\r\n仓库模块:吴克常、黄志宾、康少聪\r\n财务模块:李大文、" + 
				"周志忠"; 
			this.txtMembers.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 
			//  
			// timerShow 
			//  
			this.timerShow.Enabled = true; 
			this.timerShow.Interval = 500; 
			this.timerShow.Tick += new System.EventHandler(this.timerShow_Tick); 
			//  
			// timer1 
			//  
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick); 
			//  
			// frmMdiAbout 
			//  
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); 
			this.BackColor = System.Drawing.Color.WhiteSmoke; 
			this.ClientSize = new System.Drawing.Size(512, 286); 
			this.Controls.Add(this.panel1); 
			this.Controls.Add(this.lblVersion); 
			this.Controls.Add(this.lblTitle); 
			this.Controls.Add(this.picIcon); 
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 
			this.MaximizeBox = false; 
			this.MinimizeBox = false; 
			this.Name = "frmMdiAbout"; 
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; 
			this.Text = "关于本程序"; 
			this.Load += new System.EventHandler(this.frmMdiAbout_Load); 
			this.panel1.ResumeLayout(false); 
			this.ResumeLayout(false); 
 
		} 
		#endregion 
 
		private void frmMdiAbout_Load(object sender, System.EventArgs e) 
		{ 
			try 
			{ 
 
				this.Icon=this.Owner.Icon; 
				this.picIcon.Image = this.Owner.Icon.ToBitmap(); 
				Assembly info=Assembly.GetExecutingAssembly(); 
				object[] infos=info.GetCustomAttributes(true); 
				 
				foreach(Attribute att in infos) 
				{ 
					if(att is AssemblyTitleAttribute) 
					{ 
						this.lblTitle.Text=((AssemblyTitleAttribute)att).Title; 
					} 
				} 
				this.lblVersion.Text="版本:"+info.GetName().Version.ToString(); 
 
 
				this.txtMembers.Top=150; 
			} 
			catch(Exception ex) 
			{ 
				MessageBox.Show("系统发生一个异常的错误!请与管理员联系。","系统错误",MessageBoxButtons.OK,MessageBoxIcon.Error); 
			} 
		} 
 
		private void timerShow_Tick(object sender, System.EventArgs e) 
		{ 
			 
			if(this.txtMembers.Location.Y!=0) 
				this.txtMembers.Top-=5; 
			else 
			{ 
				this.timer1.Enabled=true; 
				this.timerShow.Enabled=false; 
			} 
		} 
 
		private bool a=true; 
		private void timer1_Tick(object sender, System.EventArgs e) 
		{ 
				if(a) 
				{ 
					this.txtMembers.Font=new Font("隶书",this.txtMembers.Font.Size+1); 
					if(this.txtMembers.Font.Size>18) 
						a=false; 
				} 
			else 
				{ 
					this.txtMembers.Font=new Font("隶书",this.txtMembers.Font.Size-1); 
					if(this.txtMembers.Font.Size<15) 
						a=true; 
				} 
 
		} 
		 
 
	} 
}