One course of action is setting the Owner of the child form to the caller, in this case your main form. So in the child form we would use something like this were we update the main form's TextBox1 and two public properties in the main form.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Me.Owner IsNot Nothing Then
Dim MainForm As Form1 = CType(Me.Owner, Form1)
MainForm.TextBox1.Text = Me.TextBox1.Text
MainForm.Item1 = 1
MainForm.Item2 = "Hello, made this change in child form"
Else
Console.WriteLine("Owner not set")
End If
End Sub
In the main form we call the child form
mChildForm = New ChildForm
mChildForm.Owner = Me
mChildForm.Show()
I have a complete `demonstration project` on Microsoft OneDrive or see code below
Main form
Public Class Form1
Private mChildForm As ChildForm
Private mFirstTime As Boolean = True
Public Property Item1 As Integer
Public Property Item2 As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DoFormWork()
End Sub
Private Sub DoFormWork()
If Not ((From f In My.Application.OpenForms.Cast(Of Form)() Where f.Name.Equals("ChildForm") Select f.Name).ToList.Count > 0) Then
mChildForm = New ChildForm
mChildForm.Owner = Me
mFirstTime = True
End If
mChildForm.Show()
If mFirstTime Then
mChildForm.Location = New Point(Me.Left + Me.Width, Top)
mFirstTime = False
End If
If chkPushText.Checked Then
mChildForm.TextBox1.Text = Me.TextBox1.Text
End If
End Sub
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
If mChildForm IsNot Nothing Then
mChildForm.Dispose()
Else
Console.WriteLine("mChildForm is Nothing")
End If
End Sub
Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Controls.OfType(Of Control).ToList.ForEach(
Sub(x)
If TypeOf x Is TextBox Then
AddHandler x.Click,
Sub(s As System.Object, a As System.EventArgs)
Dim tb As TextBox = CType(x, TextBox)
If Not String.IsNullOrEmpty(tb.Text) Then
DoFormWork()
mChildForm.TextBox1.Text = tb.Text
End If
End Sub
End If
End Sub)
mChildForm = New ChildForm
mChildForm.Owner = Me
mChildForm.Show()
mChildForm.Location = New Point(Me.Left + Me.Width, Top)
mFirstTime = False
My.Application.OpenForms(0).Activate()
DoFormWork()
End Sub
Private Sub Form1_LocationChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LocationChanged
If Not mFirstTime Then
mChildForm.Location = New Point(Me.Left + Me.Width, Top)
End If
End Sub
End Class
Child form
Public Class ChildForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click
Close()
End Sub
Private Sub cmdHideMe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdHideMe.Click
Hide()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Me.Owner IsNot Nothing Then
Dim MainForm As Form1 = CType(Me.Owner, Form1)
MainForm.TextBox1.Text = Me.TextBox1.Text
MainForm.Item1 = 1
MainForm.Item2 = "Hello, made this change in child form"
Else
Console.WriteLine("Owner not set")
End If
End Sub
End Class
Note there is a good deal of code here, it does other things besides what you asked for as it's something I did several years ago but is relevant in that it shows how to interact with parent to child forms. Now if we did this in C# a few more things would need to happen so this for now is a vb.net thing while anyone wants it in C# I can do that also.
Anyways hope this helps