Inherit Textbox control -c#

how to create a class which inherits textBox control in c# . the new class contains a new property like “Windowtype” and more.

[CustomAttributes(Browsable = true)]
public class Textbox_tushar : System.Web.UI.WebControls.TextBox
{

        public enum Size
        {
            Maximize,
            Minimize,
            Center
        }

        [CustomAttributes(Browsable = true)]
        public override string ID
        {
            get
            {
                return base.ID;
            }
            set
            {
                base.ID = value;
            }
        } 

        private Size _size;
        public Size WindowType
        {
            get { return _size; }
            set { _size = value; }
        }  

        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }
        protected override void OnTextChanged(EventArgs e)
        {
            base.OnTextChanged(e);  
        }

}

Advertisements