Your question, your audience. Choose who sees your identity—and your question—with question security.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim f2 As New Form2
f2.MdiParent = Me
AddHandler f2.FormClosed, AddressOf Child_FormClosed
f2.Show()
End Sub
Private Sub Child_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs)
MessageBox.Show("Child form closed!")
End Sub
End Class
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Change this:
Form2.MdiParent = Me
To:
ChildForm.MdiParent = Me
--------------------------
And change this:
Form2.Show()
To:
ChildForm.Show()