Can't hide base class properties
I have two controls in a DLL; one inherits from Control and the other from Form. In both cases I'd like to hide base class properties that don't make sense for the control (e.g. AllowDrop). I've read Ray Hayes' thread on
Hiding Properties and tried the following:
<Browsable(False), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), _
EditorBrowsable(EditorBrowsableState.Never)> _
Public Shadows Property AllowDrop() As Boolean
Get
End Get
Set(ByVal Value As Boolean)
End Set
End Property
This hides the property from the VS 2003 properties window but
NOT from the code editor. Everything I've read said this should work, but it doesn't. Any help would be greatly appreciated.
If you want to hide the base class, you have to use the private access modifier. This will not allow derived classes have access to these members. If you are trying to hide the methods and want to keep them visible only in the class, use protected.
Is that what you are asking?