I've written a control and Inherited a button but I only want to show
only the custom properties that I made. Is there a way to hide the
rest?
Define "hide".
If you want to "remove" them so they're not accessible in code, then
strictly; no you can't. That would break the basic principles of
Inheritance.
If you just want to hide them from the Properties window, then you have
to override/shadow each and every one, decorating it with the
Browsable(False) attribute.
To be honest, I wouldn't think this was worth the effort.
If you want to limit the properties/methods you get to play with in the
Intellisense while you're coding, look at creating an Interface that
includes these and declare your Button as the Interface Type, rather
than the actual Class, as in
Interface ICustomButton
Property ButtonText() as String
. . .
End Interface
Class CustomButton
Implements ICustomButton
. . .
Property ButtonText() As String _
Implements ICustomButton.ButtonText
. . .
End Class
Class Form1
Private btnCustom1 as ICustomButton _
= New CustomButton()
. . .
/But/ this almost certainly won't work in the Forms Designer within the
IDE!
HTH,
Phill W.