How to remove unnecessary properties from a user control?

I want to remove unnecessary properties from a user control. But I dont know how?

+4
source share
2 answers

You can remove inherited properties from the Properties window using the [Browsable] attribute:

[Browsable(false)] public override bool AutoScroll { get { return base.AutoScroll; } set { base.AutoScroll = value; } } [Browsable(false)] public new Size AutoScrollMargin { get { return base.AutoScrollMargin; } set { base.AutoScrollMargin = value; } } 

Note the difference between the two, you need to use the "new" keyword if the property is not virtual. You can use the [EditorBrowsable (false)] attribute to hide the property from IntelliSense.

+9
source

You cannot remove properties that your control inherits from UserControl .

You can, of course, delete the properties that you created yourself. Just delete them from the source file.

+1
source

All Articles