Just wondering if there's anything wrong with declaring a class inside another class:rolleyes: :)
tnx
Printable View
Just wondering if there's anything wrong with declaring a class inside another class:rolleyes: :)
tnx
No there is nothing wrong with declaring a class in another class. When you declare a ADO.NET resultset class in one of your classes, arent you already doing that :) ?
do you mean this:
or do you mean:Code:Class Class1
Class Class2
.......................
End Class
End Class
first one is noCode:Class Class1
Public myClass As Class2
End Class
second is yes
I'm actually trying the first one:D :D I dont know, maybe there's a better way to do this. The thing is that I want to use a class in one of my classes, but I don't want the public to access that inner class. But you say that's a no, tell me what to do then :)
oh well, I dont have VB right now, but can I just declare a private class in a namespace? :D because I remember I got an error or something and this is why I decided to declare two classes in each other:confused: :( :D ;) :p
Easy Make the functionailty of the class all Friend
Friend Sub mySub
that way it can only be accessed by the app it is in.
I think you can declare a class with Friend..try it
Friend Classs Class1
End Class