F
Flix
When I extend a Control and I want to hide a property at design time, I do:
public class MyButton : Button
{
[Browsable(false)]
public new System.String Text
{
get{return base.Text;}
set{base.Text=value;}
}
}
(Note that I could have used "override" instead of "new", but with inherited
properties (like "Enabled") only "new" can be used)
I've tried to do the same to hide some events from the design time property
grid:
public class MyButton : Button
{
[Browsable(false)]
public new event System.EventHandler Click
{
add{base.Click+=value;}
remove{base.Click-=value;}
}
}
But it doesn't seem to work (the event is still visible). Why?
public class MyButton : Button
{
[Browsable(false)]
public new System.String Text
{
get{return base.Text;}
set{base.Text=value;}
}
}
(Note that I could have used "override" instead of "new", but with inherited
properties (like "Enabled") only "new" can be used)
I've tried to do the same to hide some events from the design time property
grid:
public class MyButton : Button
{
[Browsable(false)]
public new event System.EventHandler Click
{
add{base.Click+=value;}
remove{base.Click-=value;}
}
}
But it doesn't seem to work (the event is still visible). Why?