在不使用[Browsable(false)]
的情况下,如何在PropertyGridControl
中隐藏父类的一些非虚拟属性?我不能使用这个,因为我不能覆盖非虚拟属性。
如果不能覆盖属性,则可以使用new
修饰符
以下是示例:
public class SomeChildClass : SomeParentClass
{
[Browsable(false)]
new public TypeOfProperty SomeProperty
{
get { return base.SomeProperty; }
set { base.SomeProperty = value; }
}
}