I derived a control to create my custom control.
However, some of the control base properties are useless from my point of
view and i would like to avoid control user to change them.
How can i do that ?
I need to hide them from Property window editor but also to make them not
reachable via code line.
thanks a lot,
In addition to what Stoitcho already said, there are other measues you can
take such as changing the property's access specifier in your derived class,
implementing "ICustomTypeDescriptor" (or using its new 2.0 cousin
"TypeDescriptionProviderAttribute)", etc (where you can completely redefine
the properties that will be accessible in a property grid). However, this is
not a panacea and will only complicate your life. My personal opinion is to
simply create a new control that wraps the old one instead of inheriting
from it. You can then delegate to the old control as needed and expose only
those properties you want. Note BTW that you usually don't need to expose
all members of the original control at once. I personally only expose those
methods/properties I actually need and add to it on an as-needed basis.