Say I have an object that is placed onto a form. It will get this
declaration:
Public Class1
Friend WithEvents ObjectName1 As SomeCompany.ObjectName
Private Sub DoSomething
Object1.method1 = True
End Sub
Public Class2
Private MainClass As Class1
Private Sub DoSomethingElse
If Object1.method1 = True Then
Object1.property1 = "hello world"
End If
End Sub
If I want to use the ObjectName1 in another class, I can't. Are Friend
declarations supposed to be seen by all classes within the same application?
If I reference ObjectName1 in Class2, it doesn't know what I'm referring
too. Using MainClass.Object1 isn't correct either.
I really need just a conceptual explanation of what I'm doing wrong and how
I should do it.
Thanks,
Brett