Dim frm2 As Form2
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
frm2 = Me.Owner
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
frm2.flag = True
Close()
End Sub
--------------------------------
Public flag As Boolean = False
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm1 As New Form1()
Me.AddOwnedForm(frm1)
frm1.ShowDialog()
If flag = False Then
Application.DoEvents()
End If
End Sub