The CLR/CLS offers a set of features and it allows the creation of global variables.
Neither C# or VB expose all of the CLR/CLS functionality and global variables is feature NOT exposed by either of them.
VB hides and does a bunch of things behind the scence.
Your application must have an entry point have wondered why you do not see a main?
When you type the name of a form class in VB it creates a shortcut to
This code
Sub test()
formTest.TextBox1.Text = "hello"
End Sub
is changed to this as shown in reflector
Friend NotInheritable Class ModuleTest
' Methods
Public Shared Sub test()
MyProject.Forms.formTest.TextBox1.Text = "hello"
End Sub
End Class
It replaces formTest with MyProject.Forms.formTest
The other project is a class library and the MY object depends on project type
How My Depends on Project Type From Link
My.Forms object is available in a Windows Forms application but not available in a console application