www.pudn.com > CSharpSerial.rar > frmComSet.cs, change:2006-04-18,size:4016b


using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
 
namespace CSharpSerialPort 
{ 
	/// <summary> 
	/// frmComSet 的摘要说明。 
	/// </summary> 
	public class frmComSet : System.Windows.Forms.Form 
	{ 
		public frmComSet() 
		{ 
			// 
			// Windows 窗体设计器支持所必需的 
			// 
			InitializeComponent(); 
 
			// 
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码 
			// 
		} 
 
		private System.Windows.Forms.ComboBox comboBox1; 
		private System.Windows.Forms.Button button1; 
		private System.Windows.Forms.Label label1; 
		private System.Windows.Forms.Label label2; 
		private Microsoft.WindowsCE.Forms.InputPanel inputPanel1; 
		private System.Windows.Forms.ComboBox comboBox2; 
		private System.Windows.Forms.MainMenu mainMenu1; 
		private System.Windows.Forms.MenuItem menuItem1; 
 
		private cResult r; 
 
		public frmComSet(cResult r):this() 
	     { 
		    this.r = r;			 
	     } 
 
 
		/// <summary> 
		/// 清理所有正在使用的资源。 
		/// </summary> 
		protected override void Dispose( bool disposing ) 
		{ 
			base.Dispose( disposing ); 
		} 
 
		#region Windows 窗体设计器生成的代码 
		/// <summary> 
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
		/// 此方法的内容。 
		/// </summary> 
		private void InitializeComponent() 
		{ 
			this.comboBox1 = new System.Windows.Forms.ComboBox(); 
			this.button1 = new System.Windows.Forms.Button(); 
			this.label1 = new System.Windows.Forms.Label(); 
			this.label2 = new System.Windows.Forms.Label(); 
			this.inputPanel1 = new Microsoft.WindowsCE.Forms.InputPanel(); 
			this.comboBox2 = new System.Windows.Forms.ComboBox(); 
			this.mainMenu1 = new System.Windows.Forms.MainMenu(); 
			this.menuItem1 = new System.Windows.Forms.MenuItem(); 
			//  
			// comboBox1 
			//  
			this.comboBox1.Items.Add("2400"); 
			this.comboBox1.Items.Add("9600"); 
			this.comboBox1.Location = new System.Drawing.Point(88, 64); 
			this.comboBox1.Size = new System.Drawing.Size(104, 20); 
			//  
			// button1 
			//  
			this.button1.Location = new System.Drawing.Point(56, 200); 
			this.button1.Size = new System.Drawing.Size(96, 24); 
			this.button1.Text = "确定"; 
			this.button1.Click += new System.EventHandler(this.button1_Click); 
			//  
			// label1 
			//  
			this.label1.Location = new System.Drawing.Point(16, 64); 
			this.label1.Size = new System.Drawing.Size(56, 16); 
			this.label1.Text = "波特率"; 
			//  
			// label2 
			//  
			this.label2.Location = new System.Drawing.Point(8, 104); 
			this.label2.Size = new System.Drawing.Size(72, 16); 
			this.label2.Text = "定时器延时"; 
			//  
			// comboBox2 
			//  
			this.comboBox2.Items.Add("50"); 
			this.comboBox2.Items.Add("100"); 
			this.comboBox2.Items.Add("300"); 
			this.comboBox2.Items.Add("400"); 
			this.comboBox2.Items.Add("500"); 
			this.comboBox2.Items.Add("600"); 
			this.comboBox2.Items.Add("700"); 
			this.comboBox2.Items.Add("800"); 
			this.comboBox2.Items.Add("900"); 
			this.comboBox2.Items.Add("1000"); 
			this.comboBox2.Items.Add("1500"); 
			this.comboBox2.Location = new System.Drawing.Point(88, 104); 
			this.comboBox2.Size = new System.Drawing.Size(104, 20); 
			//  
			// mainMenu1 
			//  
			this.mainMenu1.MenuItems.Add(this.menuItem1); 
			//  
			// menuItem1 
			//  
			this.menuItem1.Text = "    "; 
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; 
			//  
			// frmComSet 
			//  
			this.BackColor = System.Drawing.Color.White; 
			this.ClientSize = new System.Drawing.Size(234, 255); 
			this.Controls.Add(this.comboBox2); 
			this.Controls.Add(this.label2); 
			this.Controls.Add(this.label1); 
			this.Controls.Add(this.button1); 
			this.Controls.Add(this.comboBox1); 
			this.Menu = this.mainMenu1; 
			this.Text = "frmComSet"; 
 
		} 
		#endregion 
 
		private void button1_Click(object sender, System.EventArgs e) 
		{ 
			r.Result1 = comboBox1.Text; 
			r.Result2 = comboBox2.Text; 
			this.Close(); 
		} 
	} 
}