Property Overriding

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jimmy V

    #1

    Property Overriding

    Sorry about the last partial post, I will try to delete is (stupid tab
    key)...So what I wanted to do was override a property and hide it's
    set, in C# I can do this:

    Public new String Text
    {
    get { return base.Text; }
    private set { base.Text = "What I want."; }
    }

    what is the VB equivalent of this? I get a can't override because you
    are changing access of an inherited member, or something to that
    effect. Any help would be appreciated.

    Thanks,

    Jimmy V

  • =?Utf-8?B?QWRyaWFuIFZvaWN1?=

    #2
    RE: Property Overriding


    Hiding is a C#.NET concept, while shadowing is used in VB.NET. In VB.NET use
    the keyword "shadows" instead of "new". See the link below for more
    information:



    Adrian.
    --
    [Please mark my answer if it was helpful to you]




    "Jimmy V" wrote:
    Sorry about the last partial post, I will try to delete is (stupid tab
    key)...So what I wanted to do was override a property and hide it's
    set, in C# I can do this:
    >
    Public new String Text
    {
    get { return base.Text; }
    private set { base.Text = "What I want."; }
    }
    >
    what is the VB equivalent of this? I get a can't override because you
    are changing access of an inherited member, or something to that
    effect. Any help would be appreciated.
    >
    Thanks,
    >
    Jimmy V
    >
    >

    Comment

    Working...