eseabrook2008
Technical User
I've gone through the article about passing values between forms and ran into a problem.
Here the scenario:
Click a button on FORM1 and open FORM2
FORM2 has a treeview.
Select a node and pass the value back to FORM1 and populate a text box with the value.
It appears to work but once the app ends, the value of the textbox on FORM1 hasn't changed.
FORM1:
FORM2:
Here the scenario:
Click a button on FORM1 and open FORM2
FORM2 has a treeview.
Select a node and pass the value back to FORM1 and populate a text box with the value.
It appears to work but once the app ends, the value of the textbox on FORM1 hasn't changed.
FORM1:
Code:
Private Sub Label85_Click
F2.ShowDialog() <-- open FORM2
End Sub
Public Sub SetReceive(ByVal value As String)
TextBox7.Text = value
MessageBox.Show("Form 1" & value) <--displays correct
End Sub
FORM2:
Code:
Private Sub Button1_Click
node = TreeView1.SelectedNode
Do Until (node.Parent Is Nothing)
node = node.Parent
Loop
MessageBox.Show("Form 2 " & node.ToString)
Dim frmReciever As New Form1
frmReciever.SetReceive(node.ToString)
me.Close()
End Sub