Class not show outside of class library

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
T

ThunderMusic

Hi,
I'm building a class library and I use some classes in my library that I
would not like to expose when using the class library. I explain :

I use let's say Class1, Class2 and Class3. In Class1, I have an instance of
Class2 and in Class2 I have an instance of Class3. Class1 takes care of all
the operations done with class2 and class2 takes care of all the operations
done with class3.

So, I don't want Class2 and Class3 to show when a user will be using my
class lib

Is there a way to declare my classes in order for them not to show outside
of the class lib and still be able to use it within the class lib?

thanks

ThunderMusic
 
doesn't declaring it as Friend allow that to happen?

Public Class Class1
Private Class2
End Class

Friend Class Class2

End Class

I didn't test it but I think that will work for you.
Chris
 
ThunderMusic said:
I use let's say Class1, Class2 and Class3. In Class1, I have an instance
of
Class2 and in Class2 I have an instance of Class3. Class1 takes care of
all
the operations done with class2 and class2 takes care of all the
operations
done with class3.

So, I don't want Class2 and Class3 to show when a user will be using my
class lib

You will have to change the class' accessibility modifier:

Visual Basic Language Concepts -- Accessibility
<URL:http://msdn.microsoft.com/library/en-us/vbcn7/html/vbconAccessibility.asp>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top