i want to remove unnecessary properties from user control. But I do not know what way?
You can remove inherited properties from the Properties window with 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 have to use the "new" keyword if the property isn't virtual. You can use the [EditorBrowsable(false)] attribute to also hide the property from IntelliSense.
You can't remove the properties your control inherits from UserControl.
You can, of course, remove properties you've created yourself. Just delete them from your source file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With