private property

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

    #1

    private property

    Is possible to make visible on property page a private property inherited
    from a usercontrol ?

    Ex

    public class A : UserControl
    {
    private:
    __property set_Visible( bool visibled)
    {
    ....
    }
    __property bool get_Visible();
    {
    ....
    }
    }


    public class B : A
    {
    public:
    __property set_Visible( bool visibled)
    {
    ....
    }
    __property bool get_Visible();
    {
    ....
    }
    }


    The property Visible on class B is not visible on ide property page.

    Thanks in advance


  • Brandon Bray [MSFT]

    #2
    Re: private property

    Simon wrote:[color=blue]
    > Is possible to make visible on property page a private property
    > inherited from a usercontrol ?[/color]

    Unfortunately, I don't know enough about the property page in the IDE to
    answer your question directly, but I can say that at face value it doesn't
    seem possible. Private members (including properties) are not accessible to
    derived classes. What is the problem you are trying to solve?

    Cheerio!

    --
    Brandon Bray Visual C++ Compiler
    This posting is provided AS IS with no warranties, and confers no rights.


    Comment

    • Brandon Bray [MSFT]

      #3
      Re: private property

      chazmo wrote:[color=blue]
      > Have you tried using "friend"... I.e., place "friend
      > class B" inside class A...[/color]

      Unfortunately, friend classes are not supported for __gc or __value classes.
      This is because the CLR does not have any way to represent type friendship,
      and since the CLR enforces the accessibility of members a program that tries
      to access a private member of another class will not run.

      Hope that makes sense. Cheerio!

      --
      Brandon Bray Visual C++ Compiler
      This posting is provided AS IS with no warranties, and confers no rights.


      Comment

      Working...