如何重写控件

 1
 2    public class myButton : Button
 3    {
 4
 5        public myButton()
 6        {
 7            
 8        }

 9        protected override void OnCreateControl()
10        {
11            base.OnCreateControl ();
12            base.Text = "按钮";
13        }

14    }

15    public class myText:TextBox 
16    {
17        private int intCount;
18        
19        public myText()
20        {
21            
22        }

23        
24        protected override void OnClick(System.EventArgs e)
25        {
26            base.OnClick(e);
27            intCount +=1;
28            base.Text =intCount.ToString();
29        }

30    }
posted @ 2008-03-16 16:46  habin  阅读(845)  评论(1编辑  收藏  举报