0

I noticed that I can call a method that is not shared by just writing Class.Method. Coming from C#-development I don't get how this is working. The method is correctly executed even though it writes to and reads from instance variables.

example method:

Public Class FormMain Inherits System.Windows.Forms.Form
    Friend Sub Foo()
        'do instance stuff here
    End Sub
End Class

Public Class MyClass
    Private Sub Bar()
        FormMain.Foo() 'this works!?
    End Sub
End Class

Is VB.NET using the only instance if there is only one? If not, how else is this working?

Breeze
  • 2,010
  • 2
  • 32
  • 43

0 Answers0