namespace TSZ.DotNetDll.WinForms { using System; using System.Threading; using System.Windows.Forms; public class METextSelectItem : MultiEditorItem { private TextSelect ctrl; public event EventHandler ButtonClick; public METextSelectItem(string strLable) : this(strLable, string.Empty) { } public METextSelectItem(string strLable, string strText) : base(strLable, MEItemDataTypes.TextSelect, 60) { this.ctrl = new TextSelect(); this.ctrl.TextBoxCtrl.TextChanged += new EventHandler(this.Editor_ValueChanged); this.ctrl.ButtonCtrl.Click += new EventHandler(this.ButtonCtrl_Click); this.Text = strText; } private void ButtonCtrl_Click(object sender, EventArgs e) { this.OnButtonClick(e); } protected virtual void OnButtonClick(EventArgs e) { if (this.ButtonClick != null) { this.ButtonClick(this, e); } } public override System.Windows.Forms.Control Control { get { return this.ctrl; } } public override MEDataTypes MEDataType { get { return MEDataTypes.String; } } public override string Text { get { return this.ctrl.TextBoxCtrl.Text; } set { this.ctrl.TextBoxCtrl.Text = value; } } public override object Value { get { return this.Text; } set { if (value == null) { this.Text = string.Empty; } else { this.Text = value.ToString(); } } } } }