about inherits

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

    about inherits

    Can I inherits private class in public class vb.net ?

    if can't , how can I do that ? such that I want to hidden some class in
    project


  • Anand[MVP]

    #2
    RE: about inherits

    Are you looking for protected classes by any chance??

    Rgds,
    Anand


    "Tom" wrote:
    [color=blue]
    > Can I inherits private class in public class vb.net ?
    >
    > if can't , how can I do that ? such that I want to hidden some class in
    > project
    >
    >
    >[/color]

    Comment

    • Cor Ligthert

      #3
      Re: about inherits

      Tom,

      Don't you make from your private class, if you inherit that in your public
      class, directly from that a public class?

      I hope this helps,

      Cor


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: about inherits

        "Tom" <pclan@tomgroup .com> schrieb:[color=blue]
        > Can I inherits private class in public class vb.net ?
        >
        > if can't , how can I do that ? such that I want to hidden some class in
        > project[/color]

        You cannot. If a class is 'Public', its base class must be public too.
        What you can do is putting the code in a 'Friend' class and use this class
        in your public class.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        • Cor Ligthert

          #5
          Re: about inherits

          Herfried,

          Before I write something wrong. What do yo mean with this?
          [color=blue]
          > What you can do is putting the code in a 'Friend' class and use this class
          > in your public class.
          >[/color]

          Cor


          Comment

          • Herfried K. Wagner [MVP]

            #6
            Re: about inherits

            Cor,

            "Cor Ligthert" <notmyfirstname @planet.nl> schrieb:[color=blue]
            > Before I write something wrong. What do yo mean with this?
            >[color=green]
            >> What you can do is putting the code in a 'Friend' class and use this
            >> class in your public class.[/color][/color]

            \\\
            Public Class Foo
            Public Sub Bla()
            Dim i As New ImplementationD etail()
            i.Goo()
            ...
            End Sub
            End Class

            Friend Class ImplementationD etail
            Public Sub Goo()
            ...
            End Sub
            End Class
            ///

            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://classicvb.org/petition/>

            Comment

            • Cor Ligthert

              #7
              Re: about inherits

              Herfried,
              [color=blue][color=green]
              >> Before I write something wrong. What do yo mean with this?
              >>[color=darkred]
              >>> What you can do is putting the code in a 'Friend' class and use this
              >>> class in your public class.[/color][/color]
              >[/color]
              Than I have nothing to say. It was the word "Use", however I was not sure
              what you meant with that. Now it is for the OP as well clear that it is not
              a use as inheriting however instancing.

              :-)

              Cor


              Comment

              Working...