This may not be the only/best way but I have done this in the past
The forms are just classes and therefore can be used just like any other class so as long as you know the calling form you can access its properties/methods and so on.
I create a public variable in the called form (Test1Form2) to hold a reference to the calling form. In the calling form (TestForm1) I set this variable before I do the .Show() and from then its easy. You can create properties for the data you want to pass out or method for the calling form to call to collect the data or just access the data directly.
Example Below
Public Class Test2Form1
Inherits System.Windows.Forms.Form
' Property to provide value of TB2
Public ReadOnly Property Form1sTextBox2AsProperty() As String
Get
Return Me.TextBox2.Text
End Get
End Property
' Method to supply value of TB3
Public Function GetMyTextbox3AsMethod() As String
Return Me.TextBox3.Text
End Function
Private Sub Test2Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Text = "Value Got directly from the TextBox var"
Me.TextBox2.Text = "Value Passed as a Property"
Me.TextBox3.Text = "Value passed on a method call"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f As New Test2Form2
f.CallingForm = Me
f.Show()
End Sub
End Class
-------------------------------------------------------------------------------------
Public Class Test2Form2
Inherits System.Windows.Forms.Form
Public CallingForm As Test2Form1
Private Sub Test2Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox1.Clear()
' get the data direct from the field in form1
Me.TextBox1.Text = CallingForm.TextBox1.Text
' get the data from a property in form1
Me.TextBox2.Text = CallingForm.Form1sTextBox2AsProperty
' get the data by calling a method in form1
Me.TextBox3.Text = CallingForm.GetMyTextbox3AsMethod
End Sub
End Class
-------------------------------------------------------------------------------------------
A better way would be to get the reference to the calling form out of the Form_Load sender parameter, but I havnt yet worked out how to do this.
Hope this helps