using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using JXC_MIS.UserTier;
namespace JXC_MIS.UserTier.BaseForm
{
	/// <summary>
	/// frmInputBox (Prompt, [Title], [Default], [XPos], [YPos], [HelpFile], [Context]) 返回用户输入的文本。
	/// </summary>
	public class frmInputBox : System.Windows.Forms.Form
	{

		//字段
		private string m_Prompt;
		private string m_Title;
		private string m_Default;
		private string m_DataSource;

		#region 字段属性
		/// <summary>
		/// 设置输入提示
		/// </summary>
		public string Prompt
		{ 
			get {return m_Prompt;} 
			set { m_Prompt=value;} 
		} 
		/// <summary>
		/// 设置标题
		/// </summary>
		
		public string Title
		{ 
			get {return m_Title;} 
			set { m_Title=value;} 
		} 
		/// <summary>
		/// 设置缺省文本
		/// </summary>
		public string Default
		{ 
			get {return m_Default;} 
			set { m_Default=value;} 
		} 
		/// <summary>
		/// 设置下拉列表数据源
		/// </summary>
		public string DataSource
		{ 
			get {return m_DataSource;} 
			set { m_DataSource=value;} 
		} 
		#endregion

		public frmInputBox()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码否  
			//
		}

		#region 设计器
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.Button cmd_Cancel;
		private System.Windows.Forms.Button cmd_OK;
		private System.Windows.Forms.ComboBox cbo_Input;
		private System.Windows.Forms.Label lbl_Prompt;
		private System.Windows.Forms.ComboBox cbo_Input1;
		private System.Windows.Forms.Label lbl_Prompt1;
		#endregion

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;
		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmInputBox));
			this.cbo_Input = new System.Windows.Forms.ComboBox();
			this.lbl_Prompt = new System.Windows.Forms.Label();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.cmd_Cancel = new System.Windows.Forms.Button();
			this.cmd_OK = new System.Windows.Forms.Button();
			this.cbo_Input1 = new System.Windows.Forms.ComboBox();
			this.lbl_Prompt1 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// cbo_Input
			// 
			this.cbo_Input.Location = new System.Drawing.Point(16, 64);
			this.cbo_Input.Name = "cbo_Input";
			this.cbo_Input.Size = new System.Drawing.Size(312, 20);
			this.cbo_Input.TabIndex = 0;
			// 
			// lbl_Prompt
			// 
			this.lbl_Prompt.Location = new System.Drawing.Point(16, 40);
			this.lbl_Prompt.Name = "lbl_Prompt";
			this.lbl_Prompt.Size = new System.Drawing.Size(320, 16);
			this.lbl_Prompt.TabIndex = 1;
			this.lbl_Prompt.Text = "输入提示：";
			// 
			// pictureBox1
			// 
			this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(16, 0);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(32, 40);
			this.pictureBox1.TabIndex = 2;
			this.pictureBox1.TabStop = false;
			// 
			// cmd_Cancel
			// 
			this.cmd_Cancel.Location = new System.Drawing.Point(184, 8);
			this.cmd_Cancel.Name = "cmd_Cancel";
			this.cmd_Cancel.Size = new System.Drawing.Size(72, 23);
			this.cmd_Cancel.TabIndex = 3;
			this.cmd_Cancel.Text = "取消(&C)";
			this.cmd_Cancel.Click += new System.EventHandler(this.cmd_Cancel_Click);
			// 
			// cmd_OK
			// 
			this.cmd_OK.Location = new System.Drawing.Point(264, 8);
			this.cmd_OK.Name = "cmd_OK";
			this.cmd_OK.Size = new System.Drawing.Size(64, 23);
			this.cmd_OK.TabIndex = 4;
			this.cmd_OK.Text = "确定(&O)";
			this.cmd_OK.Click += new System.EventHandler(this.cmd_OK_Click);
			// 
			// cbo_Input1
			// 
			this.cbo_Input1.Location = new System.Drawing.Point(16, 136);
			this.cbo_Input1.Name = "cbo_Input1";
			this.cbo_Input1.Size = new System.Drawing.Size(320, 20);
			this.cbo_Input1.TabIndex = 5;
			this.cbo_Input1.Text = "comboBox1";
			// 
			// lbl_Prompt1
			// 
			this.lbl_Prompt1.Location = new System.Drawing.Point(16, 120);
			this.lbl_Prompt1.Name = "lbl_Prompt1";
			this.lbl_Prompt1.Size = new System.Drawing.Size(320, 16);
			this.lbl_Prompt1.TabIndex = 6;
			this.lbl_Prompt1.Text = "输入提示2：";
			// 
			// frmInputBox
			// 
			this.AcceptButton = this.cmd_OK;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(338, 103);
			this.Controls.Add(this.lbl_Prompt1);
			this.Controls.Add(this.cbo_Input1);
			this.Controls.Add(this.cmd_OK);
			this.Controls.Add(this.cmd_Cancel);
			this.Controls.Add(this.pictureBox1);
			this.Controls.Add(this.lbl_Prompt);
			this.Controls.Add(this.cbo_Input);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "frmInputBox";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Load += new System.EventHandler(this.frmInputBox_Load);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmInputBox_Load(object sender, System.EventArgs e)
		{
			this.Text =m_Title;
			this.lbl_Prompt.Text =m_Prompt;
			this.cbo_Input.Text =m_Default;
		}

		public string GetInputText()
		{
           return this.cbo_Input.Text;
		}

		private void cmd_OK_Click(object sender, System.EventArgs e)
		{
			GetInputText();
			this.Close();
		}

		private void cmd_Cancel_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}


	}//End Class
}//End Namespace
