T
Tor Inge Rislaa
How to use a public variable
In VB.6.0 I could in the declaration part of a form declare a public
variable, then assign a value to the variable, open a new form and address
the variable and read it's value in my new form.
Form1:
Option Explicit
Public MyVar As String
Private Sub Form_Load()
MyVar = "Some value"
End Sub
Form2:
Private Sub Form_Load()
Dim MyVar2 As String
MyVar2 = Form1.MyVar
End Sub
How is this done in VB.NET
T.I. Rislaa
In VB.6.0 I could in the declaration part of a form declare a public
variable, then assign a value to the variable, open a new form and address
the variable and read it's value in my new form.
Form1:
Option Explicit
Public MyVar As String
Private Sub Form_Load()
MyVar = "Some value"
End Sub
Form2:
Private Sub Form_Load()
Dim MyVar2 As String
MyVar2 = Form1.MyVar
End Sub
How is this done in VB.NET
T.I. Rislaa