Static class constructor in VB
Read documentation here. In you can do
Shared Sub New()
...
End Sub
And it will be invoked. From MSDN:
Shared constructors are run before any instance of a class type is created.
Shared constructors are run before any instance members of a structure type are accessed, or before any constructor of a structure type is explicitly called. Calling the implicit parameter less constructor created for structures will not cause the shared constructor to run.
Shared constructors are run before any of the type's shared members are referenced.
Shared constructors are run before any types that derive from the type are loaded.
A shared constructor will not be run more than once during a single execution of a program.
Kind of looks like a normal constructor in VB.NET:
Shared Sub New()
End Sub
Have you tried:
Class someClass
Public Shared somePublicMember As String
Shared Sub New()
messageBox.show("I just constructed a static class")
End Sub
End Class