How to put an extended WinForms Control on ToolBox

后端 未结 8 1973
自闭症患者
自闭症患者 2020-12-11 02:53

I plan to add functionalities to TextBox with the following:

   public class TextBoxExt : TextBox  
    {
        protected override void OnKeyPress(KeyPress         


        
8条回答
  •  清歌不尽
    2020-12-11 03:32

    You need to add a constructor to your derived class.

    public class TextBoxExt : TextBox      
    {        
        public TextBoxExt()
        {
        }
    
        protected override void OnKeyPress(KeyPressEventArgs e)        
        {            
             base.OnKeyPress(e);        
        }    
    }
    

提交回复
热议问题