Links to mysterious objects in vb.net

Hi, I need to learn VB.net for a new job that was previously a C # guy. I just find an interesting feature of VB.net. I can reference objects in a second form that has not been set!

So, from Form1 I can get the text property textbox1 on Form2 as follows

Dim txt As String = Form2.TextBox1.Text

Can anyone explain how this works? All forms are installed at the beginning of the program, and then their visibility switches throughout the program?

+5
source share
1 answer

VB - . My.Forms object My. My.Forms.TheNameOfTheForm. - , , .

.

Microsoft (!) My.Forms , , . VB6, , VB7 (.NET 1.0) , .

:

...?

, , . .

+6