VB.Net Passing values to another form

You could pass it as a parameter:

Public Sub Check(valueToCheck as String)
   'get the value to here
End Sub

Or create a property on form2 to receive it:

private _HostOrSomething As String = ""
Friend Property HostOrSomething As String
   Get
        Return _HostOrSomething 
    End Get
    Set(ByVal value As String)
        _HostOrSomething = value
    End Set

In which case, Sub Check could use _HostOrSomething since it is local var. To use these:

HOST = Test(1)
frm2.Check(HOST)

or

HOST = Test(1)
frm2.HostOrSomething = HOST
frm2.Check

Leave a Comment