how can i make the text property of an inherited label, unavailable to the user at design/run time, but still be able to use it within the class?
thanks
Printable View
how can i make the text property of an inherited label, unavailable to the user at design/run time, but still be able to use it within the class?
thanks
Edit: Nevermind. I was way off base.
I think the way to do this would be to override/shadow the Text property and make it private and then in your code when you want to change it, call MyBase.Text.
Yes I believe theres no way to "hide" a member of an inherited class. The only way to do so is to not inherit the class, but rather encapsulate it within your class.
its possible to make a property invisible like this
vb Code:
<Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Public Overrides Property Text() As String Get Return MyBase.Text End Get Set(ByVal Value As String) End Set End Property
Oh, I thought you wanted it to be invisible everywhere, except for inside the class itself.
i found the code to make it invisible everywhere now
vb Code:
Imports System.ComponentModel ''this overrides the text property + hides it from the properties ''window + the code editor <EditorBrowsable(EditorBrowsableState.Never)> _ <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _ Public Overrides Property Text() As String Get Return MyBase.Text End Get Set(ByVal Value As String) End Set End Property