1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- 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();
- }
- }
- }
- }
- }
|