Use this attribute:
[Browsable(false)] public bool AProperty {...}
For inherited properties:
[Browsable(false)] public override bool AProperty {...}
Another idea (since you are trying to hide all base classes):
public class MyCtrl : TextBox { private ExtraProperties _extraProps = new ExtraProperties(); public ExtraProperties ExtraProperties { get { return _extraProps; } set { _extraProps = value; } } } public class ExtraProperties { private string _PropertyA = string.Empty; [Category("Text Properties"), Description("Value for Property A")] public string PropertyA {get; set;} [Category("Text Properties"), Description("Value for Property B")] public string PropertyB { get; set; } }
and then for your property grid:
MyCtrl tx = new MyCtrl(); pg1.SelectedObject = tx.ExtraProperties;
The downside changes the access level of these properties from
tx.PropertyA = "foo";
to
tx.ExtraProperties.PropertyA = "foo";
source share