Results 1 to 7 of 7

Thread: [RESOLVED] [2005] text property of inherited label

  1. #1

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 03
    Location
    USA, Maryland
    Posts
    4,981

    Re: [2005] text property of inherited label

    Edit: Nevermind. I was way off base.
    Last edited by Kasracer; Jan 31st, 2008 at 12:15 PM.
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    Frenzied Member
    Join Date
    May 06
    Location
    Toronto, ON
    Posts
    1,090

    Re: [2005] text property of inherited label

    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.

  4. #4
    Raging swede Atheist's Avatar
    Join Date
    Aug 05
    Location
    Sweden
    Posts
    8,013

    Re: [2005] text property of inherited label

    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.
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

  5. #5
    vb Coda .paul.'s Avatar
    Join Date
    May 07
    Location
    Chelmsford UK
    Posts
    16,662

    Re: [2005] text property of inherited label

    its possible to make a property invisible like this

    vb Code:
    1. <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
    2. Public Overrides Property Text() As String
    3.      Get
    4.          Return MyBase.Text
    5.      End Get
    6.      Set(ByVal Value As String)
    7.  
    8.      End Set
    9. End Property

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 05
    Location
    Sweden
    Posts
    8,013

    Re: [RESOLVED] [2005] text property of inherited label

    Oh, I thought you wanted it to be invisible everywhere, except for inside the class itself.
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

  7. #7
    vb Coda .paul.'s Avatar
    Join Date
    May 07
    Location
    Chelmsford UK
    Posts
    16,662

    Re: [RESOLVED] [2005] text property of inherited label

    i found the code to make it invisible everywhere now

    vb Code:
    1. Imports System.ComponentModel
    2.  
    3. ''this overrides the text property + hides it from the properties
    4. ''window + the code editor
    5. <EditorBrowsable(EditorBrowsableState.Never)> _
    6.     <Browsable(False), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
    7. Public Overrides Property Text() As String
    8.      Get
    9.          Return MyBase.Text
    10.      End Get
    11.      Set(ByVal Value As String)
    12.  
    13.      End Set
    14. End Property

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •