Hi Experts I create an user co开发者_JS百科ntrol in windows application.
when it inherits from Control base class it would have many events and properties that may be not uses in usercontrol and I what to hide then in Properties Window.
How I can do this? thanks
use the following 3 attributes on the events or properties: when you cannot override the property, just replace 'override' with 'new'. The EditorBrowsable attribute has no effect on the properties window, but on the code editor.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
public override Color BackColor
{
get
{
//implementattion
}
set
{
//implementation
}
}
If i have understood properly, then you should change the accessor level base control methods and events to private which you want to hide from child class.
精彩评论