Source/CommandLinkTextBoxItem.cs

(完整代码) 1KB

using System;
using System.Text;
using System.ComponentModel;

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents the command link for a text box item
    /// </summary>
    public class CommandLinkTextBoxItem : CommandLink
    {
        #region Events
        /// <summary>
        /// Occurs when text in text box item has changed.
        /// </summary>
        public event EventHandler InputTextChanged;
        #endregion

        /// <summary>
        /// Gets reference to the TextBoxItem this CommandLink is linked to. Note that this is the first TextBoxItem object found by DotNetBarManager.
        /// It is possible that multiple buttons have same name see Global Items under DotNetBar Fundamentals in help file for more details.
        /// </summary>
        [Browsable(false)]
        public TextBoxItem Item
        {
            get
            {
                return this.GetItem(typeof(TextBoxItem)) as TextBoxItem;
            }
        }

        protected override void ConnectManager()
        {
            base.ConnectManager();

            if (this.Manager != null)
            {
                this.Manager.TextBoxItemTextChanged += new EventHandler(this.ItemInputTextChanged);
            }
        }

        protected override void DisconnectManager()
        {
            base.DisconnectManager();
            if(this.Manager!=null)
                this.Manager.TextBoxItemTextChanged -= new EventHandler(this.ItemInputTextChanged);
        }

        private void ItemInputTextChanged(object sender, EventArgs e)
        {
            if (InputTextChanged != null)
                InputTextChanged(sender, e);
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。