Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim F3 As New Form3
F3.ShowDialog(Me) ' <-- passing in the current instance of Form2 to our dynamic instance of Form3
End Sub
End Class
Public Class Form3
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' cast the "owner" to the actual instance of Form2 so we can use it:
Dim F2 As Form2 = CType(Me.Owner, Form2)
F2.Text = "Can you hear me now?"
End Sub
End Class
|