I've gotten used to cross-form access such as:

Code:
Form2.ShowDialog()
Form1.SelectedFile = Form2.SelectedDirectory & "\test.txt"
Form1.ShowDialog()
But recently something started bothering me...that is when I started using multiple instances of the same form.
For example, the above:

Code:
Dim f2 As New Form2()
f2.ShowDialog()
Dim f1 As New Form1()
f1.SelectedFile = f2.SelectedDirectory & "\test.txt"
f1.ShowDialog()
' Dispose it, etc.
The documentation on this is hard to find (or it is too obvious?) so I have some general questions related to this:
  • How is this sort of 'Class instance access by Class name' called in VB .NET?
  • Can I declare Classes that behave this same way, or is it only restricted to Forms?


Mainly on the second point, say I have a Class as follows:
Code:
Public Class MyClass
    Public Sub DoStuff()
        MsgBox("Stuff!")
    End Sub
End Class
How can I access this as MyClass.DoStuff() without having to make an instance of MyClass?
This is mainly interesting in my case for some places where I register 'service' classes where only one instance is required.

Important: I am not talking about making DoStuff() Shared, as I need to keep everything Local to be able to use parameters stored in an inherited class.
Method access needs to remain Local, only MyClass needs to be interpreted as a Variable like is the case with Forms.